Home › Forums › EasyTransfer Library Support Forum › Problems with ET, Ethernet, and MySQL
- This topic has 7 replies, 2 voices, and was last updated 10 years, 6 months ago by Anonymous.
-
AuthorPosts
-
December 25, 2013 at 9:23 am #3064AnonymousInactive
I’ve been successfully using SoftEasyTransfer to send two arrays of integers over SoftwareSerial from one Arduino to two others.
I added a third receiving Arduino (a Mega), and I can receive fine, both using SoftEasyTransfer (over a SoftwareSerial port), and EasyTransfer (over the Mega’s Serial1 port).
My goal, however, if to have the Mega send the data via the Ethernet and MySQL libraries right to my MySQL server, and that’s where things break down. The MySQL lbrary hangs trying to clear its internal buffer after two (sometimes three) cycles, with plenty of free memory. If I disable the ET code (and use values I generate on the Mega), it works fine.
Is there something in the ET library that would cause conflicts with the stock Ethernet library and/or the mysql_connector library (https://launchpad.net/mysql-arduino)?
Thanks.
–Noam
December 25, 2013 at 9:51 pm #3065AnonymousInactiveWell, after thinking it over for a few hours, I decided that the unit with the Ethernet adapter on it doesn’t need to *receive* the ET structure – it needs to *send* it.
So, I re-wrote the code to made that unit the sender, and it seems to be much more stable now. I’m giving it another day to be sure, before I make my final determination. –Noam
December 29, 2013 at 9:52 am #3066AnonymousInactiveWell, changing the library from receiving to sending helped, but not enough. The program still crashed.
So, I’ve removed the ET code entirely. That hasn’t helped entirely, but it might be running longer before the crash happens.
I guess now my ficus needs to go back to the Ethernet and mysql libraries, since those are the only other ones I have on this thing.
January 14, 2014 at 6:21 pm #3086BillMemberNo idea. Ever figure it out?
January 14, 2014 at 8:41 pm #3087AnonymousInactiveWell, after removing the EasyTransfer library entirely, I still had the problem.
After a lot of other testing and troubleshooting, I think that my problems ended up being due to my network itself (either the other traffic through my database server, or the NIC/drivers on the server itself). Adding a second NIC with a direct connection to the Arduino seems to have cleared it up.
After seeing that, I built a new database server (linux, not windows), and connected everything back to my network. So far, so good.
Next step is trying to add the EasyTransfer library back in, to see if I can get that working again.
May 8, 2014 at 8:19 am #3164AnonymousInactiveIt’s been a few months, and everything was working fine until this week.
I am adding another slave device into my setup, to capture electricity use and the production levels of my solar panels.
That part of the code (at least in testing mode – I haven’t wired it all up to the breaker box yet) is working.
Because of the distance between the units, I wanted to have the new “slave” send the data back to the “master” over a serial (RX,TX) connection, using EasyTransfer (of course).
So, I added a second instance of EasyTransfer (inbound on my master unit, outbound on the slave), and (as I described in another thread), I added a field to the existing (master–> slave) instance, to instruct the slave to send back its data.
Part of it is working, the other part is not. I can successfully get the data back, and process it (I’m displaying it to the serial monitor, and adding it into the main data array that is pushed to the mySQL server).
However, after the master unit receives data, it is no longer able to connect to the mySQL server (using Chuck Bell’s mysql_connector library). I’ve asked Dr. Bell for help from that end, as well.
If I don’t send the “send me data” command, the ETin.receiveData() function still runs, but has nothing new to report. The rest of the program (including the mySQL connection) runs just fine.
Is there anything in the receiveData() function that might be causing this, when there is data being received? Do I need to do something to stop the receiveData() function until I’m ready for it again?
Right now, I don’t have an “if” statement wrapping around the receiveData() function (like I do on the “slave” units). Do I need to add that, perhaps? Do you think it might help if I loop through the receive function a few times (long enough for the slave to respond with the data), and then drop out of it?
Thanks.
–Noam
May 8, 2014 at 8:43 am #3166AnonymousInactiveI just saw that the EasyTransfer library was updated about 3 months ago, but the SoftEasyTransfer library (which I’m using on the slave units) was not.
The note on the updated library *hints* that it might work over NewSoftSerial as well (without needing the SoftEasyTransfer version), but I can’t be sure if that’s true or not.
Can you tell me if the new version (the one that uses Stream instead of Serial) is compatible with a SoftwareSerial port (SoftwareSerial in IDE v1.0 and above is based on NewSoftSerial) on one end, and a hardware serial port (Serial1 on the Mega 2560)?
Thanks.
–Noam
May 12, 2014 at 11:29 am #3168AnonymousInactiveNo matter what I tried, I couldn’t get my code to work with the second EasyTransfer instance (the one receiving data from the remote slave). I could confirm that the data was received and read properly (I could print the values out to the serial monitor), but the mySQL connection would continue to fail if the master unit had received any data from the slave. I even commented out the lines that copied the received data into the proper place to be inserted into the database. It still failed.
So, I decided to remove the second EasyTransfer instance. Instead, I’m just printing the values as a comma-delimited string to the serial port, and then I wrote code to parse the values out of it on the receiving end. That has been working perfectly, so I plan to stick with it.
-
AuthorPosts
- You must be logged in to reply to this topic.