versuch
This commit is contained in:
parent
272ec0dc4c
commit
b1e2e8cd56
|
@ -2,19 +2,25 @@
|
|||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": 2,
|
||||
"execution_count": 4,
|
||||
"id": "5e0cac75",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"ename": "ModuleNotFoundError",
|
||||
"evalue": "No module named 'ipyleaflet'",
|
||||
"ename": "SerialException",
|
||||
"evalue": "[Errno 2] could not open port /dev/cu.usbmodem14201: [Errno 2] No such file or directory: '/dev/cu.usbmodem14201'",
|
||||
"output_type": "error",
|
||||
"traceback": [
|
||||
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
||||
"\u001b[0;31mModuleNotFoundError\u001b[0m Traceback (most recent call last)",
|
||||
"Cell \u001b[0;32mIn[2], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mipyleaflet\u001b[39;00m \u001b[39mimport\u001b[39;00m Map, Marker\n\u001b[1;32m 2\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mpynmea2\u001b[39;00m\n\u001b[1;32m 3\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mserial\u001b[39;00m\n",
|
||||
"\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'ipyleaflet'"
|
||||
"\u001b[0;31mFileNotFoundError\u001b[0m Traceback (most recent call last)",
|
||||
"File \u001b[0;32m/usr/local/python/3.10.8/lib/python3.10/site-packages/serial/serialposix.py:322\u001b[0m, in \u001b[0;36mSerial.open\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 321\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 322\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mfd \u001b[39m=\u001b[39m os\u001b[39m.\u001b[39;49mopen(\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mportstr, os\u001b[39m.\u001b[39;49mO_RDWR \u001b[39m|\u001b[39;49m os\u001b[39m.\u001b[39;49mO_NOCTTY \u001b[39m|\u001b[39;49m os\u001b[39m.\u001b[39;49mO_NONBLOCK)\n\u001b[1;32m 323\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mOSError\u001b[39;00m \u001b[39mas\u001b[39;00m msg:\n",
|
||||
"\u001b[0;31mFileNotFoundError\u001b[0m: [Errno 2] No such file or directory: '/dev/cu.usbmodem14201'",
|
||||
"\nDuring handling of the above exception, another exception occurred:\n",
|
||||
"\u001b[0;31mSerialException\u001b[0m Traceback (most recent call last)",
|
||||
"Cell \u001b[0;32mIn[4], line 25\u001b[0m\n\u001b[1;32m 22\u001b[0m gpx_segment \u001b[39m=\u001b[39m gpxpy\u001b[39m.\u001b[39mgpx\u001b[39m.\u001b[39mGPXTrackSegment()\n\u001b[1;32m 23\u001b[0m gpx_track\u001b[39m.\u001b[39msegments\u001b[39m.\u001b[39mappend(gpx_segment)\n\u001b[0;32m---> 25\u001b[0m ser \u001b[39m=\u001b[39m serial\u001b[39m.\u001b[39;49mSerial(\u001b[39m'\u001b[39;49m\u001b[39m/dev/cu.usbmodem14201\u001b[39;49m\u001b[39m'\u001b[39;49m, \u001b[39m9600\u001b[39;49m)\n\u001b[1;32m 26\u001b[0m sio \u001b[39m=\u001b[39m io\u001b[39m.\u001b[39mTextIOWrapper(io\u001b[39m.\u001b[39mBufferedRWPair(ser, ser))\n\u001b[1;32m 27\u001b[0m last_time \u001b[39m=\u001b[39m \u001b[39m0\u001b[39m\n",
|
||||
"File \u001b[0;32m/usr/local/python/3.10.8/lib/python3.10/site-packages/serial/serialutil.py:244\u001b[0m, in \u001b[0;36mSerialBase.__init__\u001b[0;34m(self, port, baudrate, bytesize, parity, stopbits, timeout, xonxoff, rtscts, write_timeout, dsrdtr, inter_byte_timeout, exclusive, **kwargs)\u001b[0m\n\u001b[1;32m 241\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\u001b[39m'\u001b[39m\u001b[39munexpected keyword arguments: \u001b[39m\u001b[39m{!r}\u001b[39;00m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39mformat(kwargs))\n\u001b[1;32m 243\u001b[0m \u001b[39mif\u001b[39;00m port \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m--> 244\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mopen()\n",
|
||||
"File \u001b[0;32m/usr/local/python/3.10.8/lib/python3.10/site-packages/serial/serialposix.py:325\u001b[0m, in \u001b[0;36mSerial.open\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 323\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mOSError\u001b[39;00m \u001b[39mas\u001b[39;00m msg:\n\u001b[1;32m 324\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mfd \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m\n\u001b[0;32m--> 325\u001b[0m \u001b[39mraise\u001b[39;00m SerialException(msg\u001b[39m.\u001b[39merrno, \u001b[39m\"\u001b[39m\u001b[39mcould not open port \u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m: \u001b[39m\u001b[39m{}\u001b[39;00m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mformat(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_port, msg))\n\u001b[1;32m 326\u001b[0m \u001b[39m#~ fcntl.fcntl(self.fd, fcntl.F_SETFL, 0) # set blocking\u001b[39;00m\n\u001b[1;32m 328\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mpipe_abort_read_r, \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mpipe_abort_read_w \u001b[39m=\u001b[39m \u001b[39mNone\u001b[39;00m, \u001b[39mNone\u001b[39;00m\n",
|
||||
"\u001b[0;31mSerialException\u001b[0m: [Errno 2] could not open port /dev/cu.usbmodem14201: [Errno 2] No such file or directory: '/dev/cu.usbmodem14201'"
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@ -43,7 +49,7 @@
|
|||
"gpx_segment = gpxpy.gpx.GPXTrackSegment()\n",
|
||||
"gpx_track.segments.append(gpx_segment)\n",
|
||||
"\n",
|
||||
"ser = serial.Serial('/dev/cu.usbmodem14201', 9600, timeout=5.0)\n",
|
||||
"ser = serial.Serial('/dev/cu.usbmodem14201', 9600)\n",
|
||||
"sio = io.TextIOWrapper(io.BufferedRWPair(ser, ser))\n",
|
||||
"last_time = 0\n",
|
||||
"\n",
|
||||
|
|
Loading…
Reference in a new issue