[chbot] Lightweight Linux,and serial

Mark Atherton markaren1 at xtra.co.nz
Wed May 31 21:30:50 BST 2017


Yes, thank you for the comments.

The issue isn't connectivity (have a pile of USB - serial bridges), it 
is one of managing the OS in near real-time.

Have a device with a serial interface, and unknown protocol, and wish to 
(algorithmically) generate *many* test patterns to send to it 
(serially). If any of these stimuli elicit a response, then I need to 
know about the reply to short order, and then need to take action.

Did find some simple serial management examples (in C, the chosen 
language -- hence my previous reference to GCC), and it looks much 
cleaner, and simpler than the Win equivalent.

So there is a simple problem, and was looking for a simple solution. The 
only unknown was (is) timing issues introduced by the OS.

Other option is just to build a simple bare-metal STM32 system (hardware 
needs at least two serial ports), and do it that way. This seems quite 
appealing.

Regards, Mark

On 1/06/2017 7:06 AM, Henri Shustak wrote:
> I would second Andrews comments. That all makes a lot of sense.
>
> If you have a machine with a USB port and need a serial connection (not on the board) there are USB -> Serial adapters availble.
>
> Henri
>
>
> On 30/05/2017, at 5:33 PM, Andrew Errington <erringtona at gmail.com> wrote:
>
> Don't you just need a terminal emulator in the first instance?  Type your command and display incoming bytes.
>
> Off the top of my head "screen" for command line use, or GTKterm for GUI use, or something similar for Windows and do all of your testing on the Windows machine.  Failing that, Raspbian on a Raspberry Pi, giving you a complete, useful, and cheap Linux box.
>
> Otherwise, I'd probably do it with Python and PySerial (it's cross-platform).  Watch out in Python 3 that strings must be converted to byte streams if you want them to behave as you expect.
>
> You might also find some useful tools here:
> https://blog.philippklaus.de/2011/08/sniff-serial-connection
>
> Andrew
>
> On May 30, 2017 4:44 PM, "Mark Atherton" <markaren1 at xtra.co.nz> wrote:
> Hi All,
>
> Just about to start poking serial commands at the Pan and Tilt head (following on from a posting here, maybe a month ago), and would like suggestions about a lightweight Linux distro to create the test patterns from.
>
> The P&T unit has an unknown control protocol, but am pretty sure that the signalling is RS232. There are at least three possible protocols, so need an easy way to generate test data, and to examine returned serial data.
>
> How well / simply implemented / fully buffered is serial data managed when the OS receives (binary) messages ?
>
> Basically plan to send out a test message, wait maybe 20ms, then see if any data has been received. If data is present, then dump it out as hex, if not, then move onto the next test message.
>
> Since this is close to being a real-time application, am concerned about of ease of checking for incoming messages, and of course, the possibility of incoming bytes getting dropped.
>
> Messages each way are likely to be short (less than 10 bytes), and at low speed (less than 57.6k baud).
>
> So, need a (preferably) lightweight Linux distro, which can be installed on a laptop reasonably quickly, preferably has GCC pre-installed, and is capable of being easily controlled from a win7 machine via a readily available (free) remote desktop.
>
> Thoughts, comments, and observation please.
>
> -Mark




More information about the Chchrobotics mailing list