AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Loopback test serial port3/4/2023 ![]() Syslog.syslog('Ctrl-C pressed, exiting log of %s to %s\n' % (port, outfname)) ('Ctrl-C pressed, exiting log of %s to %s\n' % (port, outfname)) Syslog.syslog('Error reading serial port %s: %s\n' % (type(e)._name_, e)) ('Error reading serial port %s: %s\n' % (type(e)._name_, e)) Print(code('ascii', errors='replace').strip()) ![]() # loop will exit with Ctrl-C, which raises a Syslog.syslog('Logging data on %s to %s\n' % (port, outfname)) ('Logging data on %s to %s\n' % (port, outfname)) Pynmea2.parse(ser.readline().decode('ascii', errors='replace')) ![]() # try to parse (will throw an exception if input is not valid NMEA) With serial.Serial(port, 57600, timeout=1) as ser: # try to read a line of data from the serial port and parse Syslog.syslog('No ports found, waiting 10 seconds.\n') ('No ports found, waiting 10 seconds.press Ctrl-C to quit.\n') Raise EnvironmentError('Unsupported platform') # this excludes your current terminal "/dev/tty" Import os, time, sys, glob, datetime, syslog, pynmea2, serial I followed the tutorial from fishandwhistle and createt this script: #!/usr/bin/python3 I am working on a NMEA(GPS)-datalogger for a drone.
0 Comments
Read More
Leave a Reply. |