Show Posts
Pages: [1] 2
1  Using Arduino / Networking, Protocols, and Devices / Re: How to access ethernet shield from multiple devices on: February 22, 2014, 04:27:38 pm
I would start by putting more serial.prints in the arduino program.  Are you monitoring the arduino serial data while you are trying to access the arduino from the browser?

If your arduino prog appears to be working but nothing happens when you put the IP address into your browser then I would suspect that the IP address or port, etc. is not right.
2  Using Arduino / Programming Questions / Re: Sending Data via LAN on: February 06, 2014, 04:15:10 pm
OK, I found a way to make it work.  I create the data to be sent as a string, then keep adding new data on,  and then change it to char once out of the loop, and it sends as desired.

Good Day,
JP.
3  Using Arduino / Programming Questions / Re: Sending Data via LAN on: February 06, 2014, 03:22:17 pm
Now I am wondering is there some way I can just keep adding three more integers to the char allin each time through the loop and then send allin after the loop is done?

Something like this:

Code:
           char allin[450];
            for(int j=0;j<6;j++)
            {            
              long senstot = 0;              
              for(int i=0;i<100;i++)
              {
                sensread = analogRead(j);
                senstot = senstot + sensread;
              }
              
              sensread = senstot/100;
              float degreex = Temperature(sensread);
              int degreedec = 10*degreex;
              
              
              append("%i, %i, %i",j, degreedec, sensread) to allin
              
              

            }
            client.print(allin);
            client.println("\t");            
  
            
            break;
      
4  Using Arduino / Programming Questions / Re: Sending Data via LAN on: February 06, 2014, 03:06:45 pm
I tried taking out the

Code:
client.println("\t");

For the browser all of the information ended up on one line.  For the Python prog same as before.  I'm thinking that the

Code:
client.print(allin);

is adding a control character that the Python prog sees but the browser does not.
5  Using Arduino / Programming Questions / SOLVED - Sending Data via LAN on: February 06, 2014, 02:14:23 pm
I have a sketch running on a UNO with a POE Ethernet shield.  It reads temperatures from the analogue ports and sends them either to a browser or, to a Python program which enters them into a database.

This bit of programming:

Code:
          for(int j=0;j<6;j++)
            {            
              long senstot = 0;              
              for(int i=0;i<100;i++)
              {
                sensread = analogRead(j);
                senstot = senstot + sensread;
              }
              
              sensread = senstot/100;
              float degreex = Temperature(sensread);
              int degreedec = 10*degreex;
              char allin[45];
              sprintf(allin, "AInput #%i, Temperature = %i, Analogue is %i", j, degreedec, sensread);
              client.print(allin);
              client.println("\t");            
            }
            
            break;
      

generates the following desired output when queried by a browser:

Quote
AInput #0, Temperature = 759, Analogue is 505   
AInput #1, Temperature = 756, Analogue is 503   
AInput #2, Temperature = 749, Analogue is 498   
AInput #3, Temperature = 746, Analogue is 496   
AInput #4, Temperature = 467, Analogue is 304   
AInput #5, Temperature = 327, Analogue is 220   

I would like to send the same info (without the descriptions) to the Python database program but if I change the sprintf to:

Code:
             sprintf(allin, "%i,  %i,  %i", j, degreedec, sensread);

only the first line makes it.  ie.:

Quote
1 759 505

I would like to recieve 1 759 505 2 749 498 3 ... at the python program.

So it looks like I need to put all of the data into one "sprintf".  Is there an easier way to do this than putting the data into an array (ie: data [6][3]) and then writing a great long sprintf?

Thanks,
JP.
6  Using Arduino / Project Guidance / Re: Analogue Input Stability on: February 28, 2013, 08:16:17 pm
Averaging out 100 readings is working like a charm.

Thanks all,
JP.
7  Using Arduino / Project Guidance / Re: Analogue Input Stability on: February 27, 2013, 06:45:43 pm
Yes, but the whole Uno, poe shield, thermistor cct is mounted in a remote location.  Anyhow, whether it is wiring or programming changes, I guess that I'll be accessing it!
8  Using Arduino / Project Guidance / Re: Analogue Input Stability on: February 27, 2013, 05:32:24 pm
Yes, swapping was the first thing that came to mind, but the poe hardware is not in an easily accessible location. 

Thanks,
JP.
9  Using Arduino / Project Guidance / Re: Analogue Input Stability on: February 27, 2013, 03:41:59 pm
Speed is not an issue.  I'm only reading one input and only reading it once every minute.

Maybe I'll try taking a number of readings, throw out the first and average the rest.

Thanks,
JP
10  Using Arduino / Project Guidance / Analogue Input Stability on: February 27, 2013, 03:20:05 pm
I am using a thermisters on Uno analogue inputs to measure temperature.

I have two Unos set up to measure temperature.  One is connected to a computer via serial port.  One has a poe ethernet shield and gets its power from a 48v EnGenius poe injector.

I have noticed that the temperature readings from the serial connected Uno are much more stable than the ethernet connected Uno.  The serial connected readings are rock solid and the ethernet connected readings bounce around +/- 2 counts.

Anybody else noticed anything similar?

I'm wondering if a little T or Pi filter on the analogue input would be a good idea?

Thanks,
JP.

11  Using Arduino / Programming Questions / Re: Making Assorted Variables into a String on: February 19, 2013, 11:46:52 am
It is working.  The only additional problem was that I could not get a float to work, %f, so I scaled the one value by a factor of ten and sent it as an integer too.

Code:
            int sensread = analogRead(3);
            float degreex = Temperature(sensread);
            int degreedec = 10*degreex;
           
            char allin[45];
           
            sprintf(allin, "Temperature = %i, Analogue is %i", degreedec, sensread);
           
            client.print(allin);

JP.

12  Using Arduino / Programming Questions / Re: Making Assorted Variables into a String on: February 19, 2013, 11:12:22 am
I guess something like this will work,
Code:
client.print(allin, "Temperature = %i, Analogue is %i", degreedec, sensread);
JP.
13  Using Arduino / Programming Questions / Re: Making Assorted Variables into a String on: February 19, 2013, 10:25:21 am
Thanks Delta,

I thought that that was a good idea too, in fact it was the first thing that I tried, but only the first, and sometimes the second client.print would show up in my Python.  I tried a whole bunch of things in Python before I went back to the Arduino to try sending data in a different format.

What I found was that as long as the data was in one client.print, even a thousand characters would transfer successfully.

JP.
14  Using Arduino / Programming Questions / Making Assorted Variables into a String on: February 19, 2013, 10:01:51 am
I am writing a sketch to send data to a python program via ethernet.  The easy way, from the Python point of view, is to combine everything into a string and send that string in one client.print command.

The problem is that I don't know haw to combine the variables and string.  What is the right way of doing what I tried to do in the following?

Code:
            int sensread = analogRead(3);
            float degreex = Temperature(sensread);
             
            char allin[25] = sensereadi + " node 1 " + degreex;

            client.print(allin);
           
Thanks,
JP.
15  Using Arduino / Networking, Protocols, and Devices / Re: PoE Injector for Arduino Uno With PoE Ethernet Shield on: November 03, 2012, 06:35:52 am
I decided to borrow the PoE injector from one of my EnGenius WAP's.  When I looked at it, it says right on it 24VDC.

So I hooked my Ethernet shield to it and... nothing.

As Westfw said, the Arduino Ethernet shield apparently needs the full 48 VDC.  Actually the specs say that it will work at 36.

JP.
Pages: [1] 2