Show Posts
Pages: [1] 2 3 ... 10
1  Using Arduino / Interfacing w/ Software on the Computer / Re: How to capture serial data and show it in a php webpage? on: January 25, 2013, 10:02:14 am
May be this will be helpfully to decide the software structure.
This battery system is inside my Atom & Linux SIP server. What I need to do when the battery system will be empty is send a cmd to the computer to shutdown itself. So for this case I think that PHP is no the option because we must have a user session on it.

So I need to execute the shutdown cmd and save in some file the battery controller string.

I think that the option will be BASH for the main and PHP for html printing

I'm correct?

Best Regards
Frank


2  Using Arduino / Interfacing w/ Software on the Computer / How to capture serial data and show it in a php webpage? on: January 21, 2013, 10:17:39 pm
Hi all!

I have my Arduino as a batery charger and batery monitor.
This send via RS-232 a string similar to this:

13.8|0.22|12.5|CRC|CR&LF

I'm using a linux server with an Apache web server.
Now I know that I must use BASH or PERL to write an script to capture this data at the serial port and parse it.

Now what is the best way to do this? capture the string into a text file using a BASH script and then read the file from the PHP page and print it in the webpage?

Best Regards!
Frank
3  Development / Other Hardware Development / Using the W5100 at 3V3 P.S.. needs SPI voltage buffers/level converter? on: November 01, 2012, 03:00:26 pm
Congratulations to the Arduino team for the Arduino ARM monster!

I want to build my own W5100 and Arduino network card. Using 3v3 at the uP I need to install the voltage level-converter for the SPI port?

If the response is yes, what are those devices that can run this function?

Best Regards!!
Frank

4  Using Arduino / Networking, Protocols, and Devices / Re: Ethercard library documentation... how to open, write, read and close a TCP SKT? on: September 25, 2012, 02:31:06 pm
Hi Tochinet,
I'm not using a web server, i'm using a raw socket as server that opens a new socket when a remote peer ask for be connected.

So I can debug all the TCP connections and each socket state from the server, in fact at the text that the server responds after a connections is established it gives me the remote socket number and the number (position) at the sever's socket.

The app keeps asking for new connections and do not close those that are established, so I think that if you index some value it must support several connections at the same time. I mean I see them opens so you need only know from what socket ID you send or get data.

Yeah, I was using 5 and it never open the socket, I don't recode all the web-client but if I set state in 5 (I wrote that variable as public variable at the class) it never opens.

I will try to decode where is the close function...

Best Regards!
Frank
5  Using Arduino / Networking, Protocols, and Devices / Re: Ethercard library documentation... how to open, write, read and close a TCP SKT? on: September 11, 2012, 04:13:37 pm
Hi all!
The tar file at the download section have include the DHCP Expire function.

The other problem that I detected is that this lib open always a new socket, I mean create a new tcp session.

I don't have any idea if keep creating socket will be crash the Arduino.

Best Regards
Frank
6  International / Fran├žais / Re: Client TCP et ENC28J60 on: September 10, 2012, 04:12:12 pm
I want to implemente a TCP client in RAW mode, I'm coding about this. Now I can't found the TCP close function, the socket never close when it open the connection again.

How I can close the socket after I get the data?

Best Regards
Frank
7  Using Arduino / Networking, Protocols, and Devices / Ethercard library documentation... how to open, write, read and close a TCP SKT? on: September 10, 2012, 01:34:19 pm
Hi all!

I'm trying to write a TCP client using this library as base.
I'm decoding the library and studing the HTML client, now two things I found that I don't know how to fix:

1) DHCP Expire function: Is not there!!, the example implement it but is not wroted at the library.
2) How the TCP socket is closed down? I can't found any call to close down the TCP connection.

For now I'm studing these:

Code:
EtherCard::clientTcpReq(&www_client_internal_result_cb,&www_client_internal_datafill_cb,hisport);
byte EtherCard::tcpSend ()
const char* EtherCard::tcpReply (byte fd)

And the close is at ??



Some example to start? or some docs about this library?
All others functions works without any isue. DHCP and DNS works realy FINE!

Best Regards!
Frank
8  Using Arduino / Networking, Protocols, and Devices / Re: Failed to configure Ethernet using DHCP on: September 07, 2012, 03:18:31 pm
I build a homemade board with a 328 and the ENC and is working great.

But some examples from ethercard are not working, all most some function at the library are missing.

The example that I can't compile is this:

Code:
GetDHCPandDNS

The function that I can't found is this:
Code:
ether.dhcpExpired()

Other thing is use the reset pin from the ENC before do the DHCP procedure.

Best Regards
Frank
9  Using Arduino / Programming Questions / Re: hex in string format to uint8_t array on: September 05, 2012, 10:32:08 am
That was the trick.... the i=+2!

I code this :

Code:
void loop(){

int i;
char tmp[3];
char buf[] = "4142434445";
tmp[2] = '\0';
uint8_t tx_buffer[20];
uint8_t len_buffer=0;


for(i=0;i<strlen(buf);i+=2) {
  tmp[0] = buf[i];
  tmp[1] = buf[i+1];
  tx_buffer[len_buffer] = strtol(tmp,NULL,16);
  len_buffer++;}

Serial.println(len_buffer);

for (i=0; i<len_buffer; i++){
  Serial.write(tx_buffer[i]);
  Serial.print(" ");

  }

delay(1000);
Serial.println();

}


The value:4142434445, this is ABCDCE leters in hex string format

What you think about my coding?

Best Regards!!
Frank
10  Using Arduino / Programming Questions / hex in string format to uint8_t array on: September 04, 2012, 02:13:23 pm
Hi all!!

My memory fails and I forget the trick to convert these:

char mystring[] = "FF0FA101"
uint8_t myuint[5];

I need to extract pair by pair each string to convert to uint8_t with the strtoul()

Best Regards!!

11  Using Arduino / Programming Questions / Re: Why the watchdog at Arduino works wrong? on: August 29, 2012, 10:03:49 pm
Allmost in my Arduino PRO the problem was that for some reason the function that reset the watchdog was commented out. I correct and compile the bootloader and now is working.


Best Regards
Frank
12  Using Arduino / Programming Questions / Re: Connect several devices to the same serial port, multiplexing technique on: August 29, 2012, 10:01:00 pm
Hi Peter!

No that is the problem, the remote devices are not close to any computer so they are connected together using RS-485 as link.
The problem is that any of them support the RS-485 addressing. I can't identify who is talking.

Best Regards !!
Frank
13  Using Arduino / Programming Questions / Connect several devices to the same serial port, multiplexing technique on: August 29, 2012, 01:04:00 pm
Hi all!

I'm doing the brainstorming thing, I need to multiplex my PC serial port in several remote serials ports that let me connect several SCADA devices.

The problem is that the SCADA device and the software of this device and the firmware do not support device ID,headers or similar. All designed to connect only one device for each serial port at the computer.

The only idea that I get is add some header to the data and then send it at the common serial and let to the remote Arduino decide if the packet id addressed to him print this data at the serial output, for the opposite way the Arduino picks the data add his local header and then print in the main serial.

Think in several devices connected via RS-485 and and several Arduinos connected to this BUS, We have other way to do this? to multiplex a serial port?

Best Regards
Frank
14  Using Arduino / Programming Questions / Re: Implement Serial over Ethernet using RFC 2217 standard on: August 21, 2012, 03:03:22 pm
Yeap, In some cases like these is more easy write your-own-protocol that code a existing one.
What is not clear is what the set the port parameters, like speed or control lines. And other issue is how to detect data from control commands.

In the mayor cases I think that is better use two ports, one for raw data and other for control, this is like re-invent the wheel because the serial port use this idea.

It's strange that cisco's note, because if you use binary data and not only text how you will decode if is a data control packet or raw data?.

I'm go to use to different ports and ready! I will apply the less-effort-law!!!

Best Regards!
Frank
15  Using Arduino / Programming Questions / Implement Serial over Ethernet using RFC 2217 standard on: August 20, 2012, 06:50:32 pm
Hi all!!

I want to implement Serial over Ethernet using the RFC-2217 specification.
Now someone have some code about this? only about the set-up of the RFC because after there do not so difficult, almost if we do not encrypt the sockets.

I found the original spec from CISCO:
http://www.faqs.org/rfcs/rfc2217.html#b

If the code is basic will be better so I can test is in some VB

Best Regards
Frank
Pages: [1] 2 3 ... 10