billroy / bitlash

Bitlash: a programmable command shell for arduino
http://bitlash.net
MIT License
341 stars 73 forks source link

bitlash without serial port #35

Open toctep9 opened 10 years ago

toctep9 commented 10 years ago

It seems that Bitlash can not work without real serial port connected. I've made setup where bitlash'ed nano connected with 'console' throught RF24 radio using setOutputHandler and doCharacter. It works fine when nano connected to computer and serial port can be initialized. When it powered from wall adapter, both of setOutputHandler and doCharacter does nothing. http://forum.arduino.cc/index.php?topic=199311.0

billroy commented 10 years ago

Puzzling that it wouldn’t work without the computer attached to USB. There is no code in initBitlash that can fail. I believe if the USB isn’t connected the output is simply dropped.

If you have TX/RX lights on your setup you might be able to see the burst of characters transmitted when Bitlash sends the startup banner, to confirm that’s happening.

It’s a little tricky to debug in these headless situations. Perhaps if you have a free LED you could turn it on at various points in the code to isolate where it’s breaking. Can you confirm, for example, that characters are being sent to Bitlash from the radio in the disconnected configuration...

-br

On Mar 27, 2014, at 2:23 PM, toctep9 notifications@github.com wrote:

It seems that Bitlash can not work without real serial port connected. I've made setup where bitlash'ed nano connected with 'console' throught RF24 radio using setOutputHandler and doCharacter. It works fine when nano connected to computer and serial port can be initialized. When it powered from wall adapter, both of setOutputHandler and doCharacter does nothing. http://forum.arduino.cc/index.php?topic=199311.0

— Reply to this email directly or view it on GitHub.

matthijskooijman commented 10 years ago

I agree with billroy - AFAIK there is nothing in the code that could even detect whether the USB serial port is attached, let alone be influenced by it. I wonder if there is some other problem - perhaps your wall adapter doesn't provide a stable voltage? Are you powering the 5V pin directly, or using a 7V+ voltage on the vin pin?

You say that "setOutputHandler and doCharacter does nothing". How did you determine this? Are you sure that the problem is with these functions, and not that for example the loop() function stops running, or that the radio stops working?

As bill says, using leds for debugging can help in this case...