UART communication

I am in the middle of a Laser build using a Smoothieboard v1.0a. While I am waiting for the laser module to arrived on a slow boat from China, I started thinking about the electronics. I picked up a Smart LCD Controller, which works well with the Smoothieboard, but then I started thinking it would be cool to have a custom panel with joysticks and buttons to control it. (I did something similar with my old CNC) Yes, I know that I could use the switch module, but using a Teensy or Arduino could be a fun project and give me more control. I am also thinking that it might be possible to read a file from the external SD and send it line by line. An added benefit, might be that I can use longer cables between the Smoothieboard and my chosen controller/screen but I have tested this yet.

So, after a quick bit of testing I am able to talk to the Smoothieboard over UART, access the Smart LCD Controller SD card, buttons, speaker and write to the display using a Teensy. So far, so good!

I couldn’t find out much info about the UART, as the smoothieware.org site has been down for a day or but using a cached version I found this…

you MUST rigidly use the ping-pong protocol, send ONE line of gcode per ok received.

One thing I noticed after trying a few commands is that M114 sends the ok first, while others such as M119, M115 send it after.(is this a bug?)

Anyway, I wondered if anyone had done anything similar and had any tips.

Regards,

Les

To answer myself.

Some commands such as M114, output text after the ok. So it is not a bug, I just need to do more research. :blush:

Regards,

Les

2 Likes

An arduino-type board with a screen sending gcode files line by line to a smoothieboard is pretty much the definition of the smoothiepanel project (http://smoothieware.org/smoothiepanel , documentation is down due to a dead server, will be back in a few days). That project was abandoned though due to the price of an android tablet with a smoothiecontrol web interface being pretty much the same, making the monochrome lcd screen feel pretty obsolete.

About talking to the board, there are scrips in the smoothie repository that show exactly how you should communicate with the board ( the ping/pong protocol ). You can also look at how smoopi or pronterface talk to smoothie, those are very good examples to follow.

Cheers.

2 Likes

Thanks for the reply Arthur.

I guess at this stage I am just thinking out loud. I should really get the laser up and running before I proceed with that part of the project, as then I will have a better understanding of what I need it to do. (Although I have been playing with 3d printers and a small cnc for half a dozen years, this will be my first laser)

At least I know after my testing, that it is possible but I guess the sensible thing to do, is make a few basic functions with the switch module to start with and see where we go from there.

Regards,

Les

2 Likes

So I have been giving this some more thought and I have another question

Lets say I want display the current position, I can obviously send an M114 gocde, but what frequency could I send at? I assume there is no way of getting the Smoothiboard to output its current position or progress (if playing a file) without modifying the firmware. Would me bombarding it with serial commands have any affect on the speed or interfere with USB communication? I guess that as I have to wait for an ok before sending a new command/gcode that the speed the Smoohieboard replies will dictate the frequency.

Regards,

Les