From: Jeff M. <jef...@za...> - 2020-10-26 14:33:16
|
May be way off base for .. if you "dabble with programming" (meaning you're not at top of your game right now), then is using jython for serial really the wisest choice? ie: pure python would do better, since it would be a more concrete thing - remove a few uncertainties. The main advantage of jython for you would be that you could also take advantage of some java libraries. Strikes me for now, if you're essentially writing pure python code to talk serial, do it in CPython so you have less surface area for issues; if you then get that working, then run it in jython and see if it still works, or if it fails; this could help you identify if theres a gap in jython or a bug in your code, and then once debugged, you could move on to the parts that need java. If you don't need java at all, then jython is probably not what you need. So, I suggest one step at a time.. debug the python code, as pure python, first, make your life easier :) On Fri, Oct 23, 2020 at 6:54 PM Jon Christopher <jon...@gm...> wrote: > Not jython-specific, but have you tried pyserial by any chance? > > It looks pretty simple: > > https://pyserial.readthedocs.io/en/latest/shortintro.html > <https://urldefense.com/v3/__https://pyserial.readthedocs.io/en/latest/shortintro.html__;!!Bqsxq_o9!j9GtPJ3b0SAlYpyrm_V5GFdXY-3_8Wg0TOZT7kNHE8uftc1xxTjtmPVf9uetHHptpoE$> > > >>> ser = serial.Serial('COM3', 38400, timeout=0,... parity=serial.PARITY_EVEN, rtscts=1)>>> s = ser.read(100) # read up to one hundred bytes... # or as much is in the buffer > > > > > > On Fri, Oct 23, 2020 at 2:34 PM James Kelly <jwk...@gm...> wrote: > >> Hi, >> I'm aware of the fact that I'm about to ask a lot of the group but I do >> need the help. I dabble with programming but have to acknowledge that what >> I need is beyond my abilities to develop; so I hope the group will take >> mercy on an old retired model railroader. >> I have an Arduino that I need to pass ASCII to/from a computer through a >> USB COM1 port. I want to use Jython as I am running Win-10 with a JRE. >> I find a lot of code samples, most using the RXTX library, but nothing >> demonstrating a way the user can input data to send and and at least a >> print statement to show the ASCII input. Most code seems to be in Java and >> I know from reading that it can be used from within Jython. >> I'm old school (before OOP) and to be honest I find the code snippets to >> be confusing. Is there a working example on-line or in a reference book >> that demonstrates what I need -- start to finish? >> Jim K. >> Houston TX. >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users >> <https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/jython-users__;!!Bqsxq_o9!j9GtPJ3b0SAlYpyrm_V5GFdXY-3_8Wg0TOZT7kNHE8uftc1xxTjtmPVf9uetuNZk1Zo$> >> > _______________________________________________ > Jython-users mailing list > Jyt...@li... > > https://urldefense.com/v3/__https://lists.sourceforge.net/lists/listinfo/jython-users__;!!Bqsxq_o9!j9GtPJ3b0SAlYpyrm_V5GFdXY-3_8Wg0TOZT7kNHE8uftc1xxTjtmPVf9uetuNZk1Zo$ > -- Jeff Mitchell Sr Application Architect Zayo | Our Fiber Fuels Global Innovation 1821 30th Street | Unit A | Boulder, CO 80301 Desk: 999.999.9999 | Cell: 999.999.9999 jef...@za... Purpose <http://zayo.is/signature-purpose> | Network Map <http://zayo.is/signature-network> | LinkedIn <http://zayo.is/signature-linkedin> | Twitter <http://zayo.is/signature-twitter> This communication is the property of Zayo and may contain confidential or privileged information. If you have received this communication in error, please promptly notify the sender by reply e-mail and destroy all copies of the communication and any attachments. He who dies with the best barbecue sauce, wins. |