I’m using PHP to talk to the Arduino but I’ve noticed something that I’m hoping someone can clue me in on… If I send code to the Arduino right after the computer boots, then go to my web page, the php code works fine (serial data goes back and forth correctly) If I just go to the web page without first sending code, then it doesn’t work. The php code sets the baud to 9600 and I’ve verified this works via stty -F So, I took a look to see what the settings were before and after code was sent to the arduino and it was changing more than just the speed. So I wrote a bash script to match the settings and ran that after a fresh reboot and the settings match but the php code still won’t work unless I first send the code to the board. Any thoughts? Thanks!
Not the dreaded auto-reset screwing things up ?. I needed to do some jiggery pokery to stop the board resetting every time you fired up a serial connection.....
Well that is part of it. If I use the resistor trick, it doesn't reset but the communication still won't work. If I send the code first, then there is no reset and everything works fine even without the resistor. Everything seems to point to the Arduino environment setting up something when it sends code that I'm not doing.
The board reset via the FTDI USB inrerface has good/bad points. Good for program development, bad for infield implementation. You may need to use need to another serial adapter and inverter and communicate with the arduino using the tx/rx pins on the board.
I guess what I'm trying to figure out is why everything works if I send code first from the Arduino environment and if there is way I can do this via my code. If I need to I can run the separate pins but it seems like it wouldn't be necessary.