⚠️ This forum has been restored as a read-only archive so the knowledge shared by the community over many years remains available. New registrations and posting are disabled.

All times are UTC + 8 hours




Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sep 23rd, '13, 20:23 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Jan 18th, '11, 08:29
Posts: 481
Images: 0
Location: Western NC
Gender: Male
Are you human?: Unknown Cyborg
Location: North Carolina
I didn't get the "Global variables use 1,649 bytes (80%) of dynamic memory, leaving 399 bytes for local variables. Maximum is 2,048 bytes." message on mine, is that with DHCP off? Make sure to leave anything you aren't using off like light support.

Probably the easiest way to debug the Uno is to hook it up to USB and run the Serial Monitor in the Arduino IDE. That will let you see the debugging output and see if anything is going.

You probably already did but make sure to point the servip variable to your linux box's IP and open the port in it's firewall (UDP).


Top
 Profile  
Reply with quote  
    Advertisement
 
PostPosted: Sep 24th, '13, 13:42 
Newbie
Newbie

Joined: Sep 22nd, '13, 22:23
Posts: 12
Gender: Male
Are you human?: yes
Location: australia
Thanks for the replies..

I ran the serial monitor and get the following cont scrolling

DS1307 Testsketch
Format is "hh:mm:ss dd-mm-yyyy DDD"
MEZ=0, MESZ=1 : 0

165:165:85 165-165-2165 MON seconds since 1.1.2000:1076433489 MEZ=0, MESZ=1 : 0 - Address in NV-RAM is: 0 - Clock was set!
165:165:85 165-165-2165 MON seconds since 1.1.2000:1076433489 MEZ=0, MESZ=1 : 0 - Address in NV-RAM is: 1 - Clock was set!
165:165:85 165-165-2165 MON seconds since 1.1.2000:1076433489 MEZ=0, MESZ=1 : 0 - Address in NV-RAM is: 2 - Clock was set!
165:165:85 165-165-2165 MON seconds since 1.1.2000:1076433489 MEZ=0, MESZ=1 : 0 - Address in NV-RAM is: 3 - Clock was set!
165:165:85 165-165-2165 MON seconds since 1.1.2000:1076433489 MEZ=0, MESZ=1 : 0 - Address

I have tried with dhcp on and off, same result.
I also tried changing mac address to something like byte eth_mac[] = { 0xBE, 0xEF, 0xBE, 0xEF, 0xF0, 0x0D };
still looking at what could be wrong

really odd.


Top
 Profile  
Reply with quote  
PostPosted: Sep 24th, '13, 20:14 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Jan 18th, '11, 08:29
Posts: 481
Images: 0
Location: Western NC
Gender: Male
Are you human?: Unknown Cyborg
Location: North Carolina
Yeah, that's not the program so I guess it never got written to the Uno. It says it's a DS1307 (RTC) test program.


Top
 Profile  
Reply with quote  
PostPosted: Sep 25th, '13, 13:37 
Newbie
Newbie

Joined: Sep 22nd, '13, 22:23
Posts: 12
Gender: Male
Are you human?: yes
Location: australia
I seem to have a faulty arduino, borrowed another UNO and now I have it partially working..

ie it is sending a packet to server... but

on server I get a Packet Size Error message on server (message from a.out file which is compiled server.cpp file)

Packet size from arduino is not corresponding to what server.cpp is expecting..

Can you explain about how packet size works, building/tweaking server.cpp so packet size matches up???


Top
 Profile  
Reply with quote  
PostPosted: Sep 25th, '13, 13:40 
Newbie
Newbie

Joined: Sep 22nd, '13, 22:23
Posts: 12
Gender: Male
Are you human?: yes
Location: australia
Error: Received packet size != sizeof(SENSOR_PACKET)
Error: Received packet size != sizeof(SENSOR_PACKET)


Top
 Profile  
Reply with quote  
PostPosted: Sep 25th, '13, 14:08 
Newbie
Newbie

Joined: Sep 22nd, '13, 22:23
Posts: 12
Gender: Male
Are you human?: yes
Location: australia
On Arduino Monitor:

Temperature Sender starting up...
Attempting to get IP address with DHCP...
Obtained IP: 192.168.100.133
Bound UDP port...
Init sensors...
Number of 1-wire devices: 1
Setup complete.
Requesting temperatures... done
Temp 0: 28.62
Getting light value... 325
Requesting temperatures... done
Temp 0: 28.62
Getting light value... 280


and attaching a packet capture file

No. Time Source Destination Protocol Length Info
1 0.000000000 192.168.100.133 192.168.100.135 UDP 60 Source port: 28444 Destination port: 28444

Frame 1: 60 bytes on wire (480 bits), 60 bytes captured (480 bits) on interface 0
Ethernet II, Src: ae:ad:be:bf:f0:0f (ae:ad:be:bf:f0:0f), Dst: Hewlett-_43:ce:74 (00:14:c2:43:ce:74)
Internet Protocol Version 4, Src: 192.168.100.133 (192.168.100.133), Dst: 192.168.100.135 (192.168.100.135)
User Datagram Protocol, Src Port: 28444 (28444), Dst Port: 28444 (28444)
Data (17 bytes)

0000 4c 43 41 50 02 ae ad be bf f0 0f ff 01 6a 01 e4 LCAP.........j..
0010 41 A
Data: 4c43415002aeadbebff00fff016a01e441
[Length: 17]


Attachments:
Adruino.zip [444 Bytes]
Downloaded 256 times
Top
 Profile  
Reply with quote  
PostPosted: Sep 25th, '13, 20:17 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Jan 18th, '11, 08:29
Posts: 481
Images: 0
Location: Western NC
Gender: Male
Are you human?: Unknown Cyborg
Location: North Carolina
In server.h, try adding this above line 45 (the line above struct SENSOR_PACKET {):
#pragma pack(1)

Then after the closing }; of the struct add:
#pragma pack()

Then recompile the server.


Top
 Profile  
Reply with quote  
PostPosted: Sep 25th, '13, 21:15 
Newbie
Newbie

Joined: Sep 22nd, '13, 22:23
Posts: 12
Gender: Male
Are you human?: yes
Location: australia
It worked!

Thanks for that pragma line!!

I see the log file update every 5mins on svr - fantastic!

here is some data
1380113100 temp 28:03:3B:40:00:00:00:53 27.56
1380113100 temp 28:85:71:AC:01:00:00:AF 27.88
1380113100 light AE:AD:BE:BF:F0:0F:FF:01 370
1380113400 temp 28:03:3B:40:00:00:00:53 27.75
1380113400 temp 28:85:71:AC:01:00:00:AF 28.12
1380113400 light AE:AD:BE:BF:F0:0F:FF:01 292
1380113700 temp 28:03:3B:40:00:00:00:53 27.75
1380113700 temp 28:85:71:AC:01:00:00:AF 28.06
1380113700 light AE:AD:BE:BF:F0:0F:FF:01 293
1380114000 temp 28:03:3B:40:00:00:00:53 27.81
1380114000 temp 28:85:71:AC:01:00:00:AF 28.12
1380114000 light AE:AD:BE:BF:F0:0F:FF:01 420



question about the strange time stamp on the left
what exactly is this time 1380114000??
its 10pm on the svr.. turned on time stamp/update on arduino,
be nice to have the basic 22:00 format, perhaps just even have the server time stamp directly at time of writing..?

thanks again for your time and patience!


Top
 Profile  
Reply with quote  
PostPosted: Sep 25th, '13, 21:21 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Jan 18th, '11, 08:29
Posts: 481
Images: 0
Location: Western NC
Gender: Male
Are you human?: Unknown Cyborg
Location: North Carolina
yeah, that can be added. That number is a unix timestamp; if your frontend is going to be written in PHP you can use it with the date() function to print a time/date in any format.


Top
 Profile  
Reply with quote  
PostPosted: Sep 25th, '13, 21:46 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Jan 18th, '11, 08:29
Posts: 481
Images: 0
Location: Western NC
Gender: Male
Are you human?: Unknown Cyborg
Location: North Carolina
Here you go, this adds the readable time and date to the log.


Attachments:
logging_server_with_datetime.zip [15.85 KiB]
Downloaded 294 times
Top
 Profile  
Reply with quote  
PostPosted: Sep 26th, '13, 21:51 
Newbie
Newbie

Joined: Sep 22nd, '13, 22:23
Posts: 12
Gender: Male
Are you human?: yes
Location: australia
thanks for update, that looks much neater now.

Now to figure out how to get that file into a mysql db for archiving etc..


Top
 Profile  
Reply with quote  
PostPosted: Sep 26th, '13, 21:58 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Jan 18th, '11, 08:29
Posts: 481
Images: 0
Location: Western NC
Gender: Male
Are you human?: Unknown Cyborg
Location: North Carolina
you could alter the source to write SQL queries to a file, or just have it log to mysql directly.


Top
 Profile  
Reply with quote  
PostPosted: Sep 27th, '13, 14:03 
Newbie
Newbie

Joined: Sep 22nd, '13, 22:23
Posts: 12
Gender: Male
Are you human?: yes
Location: australia
I am on a steep learning curve again with arduino data logging and mysql..
So now I have the arduino logging temp/light levels from greenhouse to webserver flat file. (thanks to your good work!)

As I understand the arduino itself cannot post data direct to mysql on its own correct (ie you can only do GET, PUT, or POST).
I would need some other application, like a PHP script, to get the data from that flat file from your current logger , and construct the SQL commands to insert the data in the database or is there a simpler way? :dontknow:


Top
 Profile  
Reply with quote  
PostPosted: Sep 27th, '13, 20:56 
Bordering on Legend
Bordering on Legend
User avatar

Joined: Jan 18th, '11, 08:29
Posts: 481
Images: 0
Location: Western NC
Gender: Male
Are you human?: Unknown Cyborg
Location: North Carolina
You do have a few options, yeah:

a) modify the LoggingServer to write SQL queries to a file,
b) make a PHP or bash script to read datalog.txt and make SQL queries from it, or
c) modify it to log to MySQL directly. MySQL's C api is pretty easy so don't let it freak you out or anything.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 29 posts ]  Go to page Previous  1, 2

All times are UTC + 8 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group
Portal by phpBB3 Portal © phpBB Türkiye
[ Time : 0.043s | 14 Queries | GZIP : Off ]