jacklinquan / usbserial4a

Python package for Android USB host serial port.
MIT License
62 stars 17 forks source link

Sending text doesnt work #14

Closed JavedWilde closed 1 year ago

JavedWilde commented 1 year ago

hi, im planning to use this library to make a custom grbl controller. I installed Pytool Usb Serial app to test it. i was able to connect and get the grbl text (whatever grbl spits out on connection) on the terminal, but it doesnt respond to any commands.

Any help?

jacklinquan commented 1 year ago

Hi @JavedWilde ,

It was a good sign that the app PyTool USB Serial received something from your device. Could you break down the test steps you went through and describe what you observe step by step? For every step, record something like what you received from the device? And what you entered in the input field and which button you pressed to try to send? And is it set in "Text" mode or "Hex" mode? And do you have an oscilloscope to check the tx line (the signal to your grbl device)? What did you find? The more information you give, the better I can help you with it.

JavedWilde commented 1 year ago

hi, i dont have an oscilloscope, i am connecting my android device with an arduino nano which has ch340 usb drivers via a usb c cable. the nano has grbl version 1.1f flash on it. im running at 115200 baudrate.

when i connect to the nano i get the grbl startup message in the terminal of pytool usb serial, ie image im sending the command "$$" which is supposed to show the grbl config, but it doesnt happen. the RX light on the nano does light up for a split second when i send the command, but no tx light.

doing the same on arduino ide's serial monitor lights up both rx and tx for a split second when i enter the same command.

im not in hex mode, im using the terminal tab on the pytool usb serial app and im pressing the send button in that tab.

any idea what might be wrong?

JavedWilde commented 1 year ago

Update: adding a newline after the command fixed the issue somehow.

sending text without a newline doesnt do anything

jacklinquan commented 1 year ago

Hi @JavedWilde , A grbl message requires a "carriage return" character to signal the end of the message. By default, "PyTool USB Serial" does not append any line ending to the message you sent out. To add a "carriage return" for the message, please go to "Settings" tab and select "CR". Have a try and let me know how it goes.

jacklinquan commented 1 year ago

Hi @JavedWilde , Great! You just found it 1 minute ago.

JavedWilde commented 1 year ago

lol timing :) thanks for the message, it makes sense now