Replies: 3 comments 3 replies
-
Not sure I understand what you have been trying to achieve - is it mixing data from two clients to the single Pico USB port and sending responses back to both?
At least post the C program if you want anybody to come up with suggestions? |
Beta Was this translation helpful? Give feedback.
-
Data coming from the grblHAL controller is not an issue. There is no evidence of data loss in this direction. With data going to the controller separating the real time commands and then buffering the other commands is something I have yet to try. However, I have no problem when using USB to a TTL serial converter this suggests there something else going on. The difference between ttyUSB0 and ttyACM0 looks like it may hold the answer. This is where my knowledge fails me and I need help.
Mixing gcodes from two clients can be achieved providing care is taken to manage the two streams. I have linked my program to the software with fifo pipes. Both clients get any data from grblHAL. bCNC will only send commands when it is active. When IDLE status is being recieved my program can send gcode commands. bCNC will update position and show IDLE/RUN/JOG status even though it did not send the gcode responsible for the activity. This is what I was hoping for and in tests earlier today I was able to see this working reliably. |
Beta Was this translation helpful? Give feedback.
-
Finally got round to buffering traffic from bCNC to grblHAL. To get round the realtime command problem I put everything into a buffer until a launch character is added to the buffer. Defining the launch character as \n ~ ! ? Cntrl-X and anything >=0x7E. Note I do not buffer traffic from grblHAL to bCNC. The result SUCCESS I can now get grblHAL to execute commands from bCNC without a problem. I don't think this is a 64 byte packet problem otherwise a direct link avoiding my program would not have worked either. Given everything that has occured it looks much more likely to be a timing issue where gaps between characters are causing the whole command to be ignored. The lack of an error message suggests that delivery of a command fragment is not occuring. |
Beta Was this translation helpful? Give feedback.
-
I have bCNC on a RPi communicating with grblHAL on a PiPico via usb. This works when bCNC is connected via ttyACM0. However, I want to add data from my own software to the connection. So I wrote a C program to create a pseudo terminal (/dev/pts/2) and interchange data petween ttyACM0 and pts/2. With bCNC connected to the pseudo terminal pts/2. I can open the terminal on bCNC and commands such as '?' & '$$' work fine. When I try to execute a jog or any lengthy G-code command most of the time it is ignored by grblHAL. There is no error code and on the odd occasions when it works it functions correctly.
I have tried a number of different termios settings for the terminals to no avail.
However, configuring grblHAL for serial input and connecting via a USB to TTL convertor module solves the problem and my program transfers data without any problems. grblHAL executing all commands without error. In this case the the terminal used is ttyUSB0 rather than ttyACM0.
I want to avoid using the extra module required by this work round. I am concerned that the use of usb input on the PiPico may have limitations and my software has pushed it over the edge. I would appreciate any thoughts / fixes for this issue.
Beta Was this translation helpful? Give feedback.
All reactions