Programatically identifying Propellers
escher
Posts: 138
in Propeller 1
Is there a way to identify Props the same way that e.g. the Propeller IDE does via "Identify Hardware", where it scans the COM ports and identifies which one a prop is plugged into?
I want to extend it in my application to detect multiple props.
Thanks!
I want to extend it in my application to detect multiple props.
Thanks!
Comments
Via USB port. It's been almost a comedy all the ways I've tried to figure this out myself:
Looking at the open source Propeller IDE code, and going down the rabbit hole of C++ calls leading to some esoteric dead ends.
Looking at the open source Propellant code, which also dead ends.
Looking at the open source P1 bootloader, which gives me an idea of what's going on with the "Identify Hardware" response but isn't opaque.
Sniffing the TX/RX lines w/ my digital logic analyzer, but getting garbage regardless of the baud.
At this point I just want to know what serial packets I need to send to a given COM port to trigger a P1 on that port to respond with an identifying response, and what that respose should look like.
My use case is that I have a system of P1s, and there may be dozens of COM ports in use on the computer. I want to scan over the ports, identify which ones are hosting P1s, and then I can move on to working with only those ports.
Thanks!
-Phil
On Linux by way of comparison, the first serial USB that is plugged in becomes ttyUSB0 etc. No guessing which port it is connected to if it's the only one plugged in.
Is it Windows, or is it the FTDI driver? I suspect the latter.
-Phil
Here is a description of the serial boot sequence: https://forums.parallax.com/discussion/comment/1209149/#Comment_1209149
The whole thread is about Serial Loaders, an there are maybe ten others. There is also a Spin code in the library that shows how to detect a propeller an load it (PropellerLoader.spin).
Andy
As far as I can tell, the only way to do that programatically is to disable its gui, redirect its output to a file, open that file, parse that file, and determine from that if a given port has a P1 on it - because for some reason /id doesn't print anything to stdout and explicit redirection doesn't work. THEN you have to repeat that process for every single port. On top of that, it's not cross-platform compatible. I appreciate the suggestion though, I definitely tried to squeeze a solution out of it.
THIS is the holy grail I couldn't find. Thank you @Ariba!