Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static Ethernet #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Static Ethernet #42

wants to merge 1 commit into from

Conversation

jsebrof
Copy link
Collaborator

@jsebrof jsebrof commented Jul 11, 2019

Modified Ethernet access to use a Static IP Address, instead of DHCP. Also added error checking to all Ethernet function calls. Fixed some formatting issues.

Modified Ethernet access to use a Static IP Address, instead of DHCP. Also added error checking to all Ethernet function calls. Fixed some formatting issues.
@jmicrobe
Copy link
Owner

When I compile the sketch I get the error message:
sketch_jul16a:111: error: 'IPAddress dns' redeclared as different kind of symbol /Applications/Arduino.app/Contents/Resources/Java/libraries/Ethernet/Dhcp.h:64: error: previous declaration of '<anonymous enum> dns'

but if I change the dns name as per this arduino forum post, it compiles fine. I'm going to load these changes to the odin and test it for a bit.

@jsebrof
Copy link
Collaborator Author

jsebrof commented Jul 16, 2019 via email

@jmicrobe
Copy link
Owner

Something isn't working with the new code. It will send the calibration and then the first reading to the server, but nothing else. I've replicated this 3 times now, and each time the ODIn keeps running without issue but data isn't reaching the server. I updated the pi after the first attempt and that didn't seem to fix it.

@jsebrof
Copy link
Collaborator Author

jsebrof commented Jul 17, 2019 via email

@jmicrobe
Copy link
Owner

Yep! SD card readings look fine.

@jsebrof
Copy link
Collaborator Author

jsebrof commented Jul 17, 2019 via email

@dacb
Copy link
Collaborator

dacb commented Jul 17, 2019

Are the packets getting to the Pi? E.g. have you tried doing tcpdump?

@jmicrobe
Copy link
Owner

@dacb I don't have tcpdump on the pi but could add it. Does netstat provide useful info? Here's the output for netstat -s:

Ip:
    464912 total packets received
    304856 with invalid addresses
    0 forwarded
    0 incoming packets discarded
    106094 incoming packets delivered
    1655 requests sent out
    36 outgoing packets dropped
Icmp:
    84 ICMP messages received
    0 input ICMP message failed.
    ICMP input histogram:
        destination unreachable: 84
    84 ICMP messages sent
    0 ICMP messages failed
    ICMP output histogram:
        destination unreachable: 84
IcmpMsg:
        InType3: 84
        OutType3: 84
Tcp:
    0 active connections openings
    19 passive connection openings
    0 failed connection attempts
    2 connection resets received
    1 connections established
    517 segments received
    344 segments send out
    5 segments retransmited
    0 bad segments received.
    3 resets sent
Udp:
    72335 packets received
    84 packets to unknown port received.
    0 packet receive errors
    697 packets sent
    IgnoredMulti: 32021
UdpLite:
TcpExt:
    1 invalid SYN cookies received
    11 TCP sockets finished time wait in fast timer
    2 delayed acks sent
    1 delayed acks further delayed because of locked socket
    Quick ack mode was activated 2 times
    47 packet headers predicted
    228 acknowledgments not containing data payload received
    8 predicted acknowledgments
    26 other TCP timeouts
    TCPLossProbes: 2
    2 DSACKs sent for old packets
    1 DSACKs received
    1 connections aborted due to timeout
    TCPDeferAcceptDrop: 16
    TCPRcvCoalesce: 2
    TCPAutoCorking: 10
    TCPSynRetrans: 3
    TCPOrigDataSent: 249
    TCPHystartTrainDetect: 1
    TCPHystartTrainCwnd: 20
IpExt:
    InMcastPkts: 71484
    OutMcastPkts: 538
    InBcastPkts: 33371
    InOctets: 76041188
    OutOctets: 144387
    InMcastOctets: 32241139
    OutMcastOctets: 20266
    InBcastOctets: 5770009
    InNoECTPkts: 464912

@jsebrof
Copy link
Collaborator Author

jsebrof commented Jul 18, 2019

Not really seeing what might be causing the problem in the code.
Do you remember when you tested it if any of the LCD messages from the sendpacket() function were displayed?
It might also be beneficial to run another test, but log the serial output.
The sendpacket() function should begin with the serial message, "Sending data via Ethernet."
If we see that message in the serial logs then it definitely entered the function, and if there was a problem, then the error messages should be logged.

@jmicrobe
Copy link
Owner

Here's the serial output for a run I just started. This starts with the message after the calibration and first readings are taken. I confirmed that these both were sent to the file on the server.

Writing to 7M18D.csv...done.
Sending data via Ethernet.
Lowering Platform
Actuator Position: 0
Starting Shaker Table

The scan time is 168630
The timestep is 3600000
The delay time is 3431370
waiting until next sampling time

Here's the serial output at the end of the 2nd reading is taken, 10 minutes later:

beginning sample
Waiting for Shaker Table to stop
Raising Platform
Actuator Position: 0
728245


0	1	2	3	4	5	6	7	
1585	1613	1588	1590	1591	1591	1587	1610	

8	9	10	11	12	13	14	15	
1589	1608	1605	1597	1591	1603	1593	1593	

16	17	18	19	20	21	22	23	
1599	1593	1586	1599	1595	1592	1590	1587	

24	25	26	27	28	29	30	31	
1608	1593	1594	1610	1597	1592	1597	1611	

32	33	34	35	36	37	38	39	
1597	1590	1591	1605	1599	1605	1611	1614	

40	41	42	43	44	45	46	47	
1590	1595	1594	1593	1607	1605	1587	1601	

48	49	50	51	52	53	54	55	
1597	1596	1592	1605	1600	1606	1596	1598	

56	57	58	59	60	61	62	63	
1604	1612	1611	1599	1588	1588	1607	1590	

Writing to 7M18D.csv...done.
Sending data via Ethernet.
Lowering Platform
Actuator Position: 0
Starting Shaker Table

The scan time is 176619
The timestep is 600000
The delay time is 423381
waiting until next sampling time

According to the server's timestamps, this data should have been received around 11:14am, and at the time of writing I'm still not seeing anything. Here are the results of 'netstat -suna' on the pi:

muninn@d-stahl-18:~ $ netstat -suna
IcmpMsg:
    InType3: 84
    OutType3: 84
Udp:
    148881 packets received
    84 packets to unknown port received.
    0 packet receive errors
    1086 packets sent
    IgnoredMulti: 73760
UdpLite:
IpExt:
    InMcastPkts: 148096
    OutMcastPkts: 1239
    InBcastPkts: 76154
    InOctets: 160711219
    OutOctets: 251006
    InMcastOctets: 58371753
    OutMcastOctets: 42698
    InBcastOctets: 12976596
    InNoECTPkts: 1076952

@jsebrof
Copy link
Collaborator Author

jsebrof commented Jul 18, 2019

Ok, so the system isn't reporting that there are any errors when sending the Ethernet packets to the Server. Before we continue the investigation, could you re-load the DHCP code that I had made previously, and double-check that it is only when running this Static-IP code that the Server data is missing?

@jmicrobe
Copy link
Owner

Okay I just uploaded the code from branch jsebrof-patch-1 and ran it without issue. Data gets sent to the server and continues to as expected.

@jsebrof
Copy link
Collaborator Author

jsebrof commented Jul 19, 2019

Thanks for double-checking. This clearly indicates that the problem is with the Static-IP code on the Arduino, and not the Server. I'll look into it some more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants