Skip to main content
added 237 characters in body
Source Link
Milliways
  • 63k
  • 33
  • 114
  • 228

It is far from clear what you have connected, what OS, what code you are actually using or how you installed modules.

No module named 'serial' means the code won't compile because you haven't installed it.

Normally you would install with sudo apt install python3-serial.

Even if you fix the code it won't work as /dev/ttyAMA0 is connected to Bluetooth on most Pi, but it certainly isn't "a TTY to USB converter".

See How do I make serial work on the Raspberry Pi3 or later

The following is a simple test program (not elegant python) that works on the Pi default serial port.

#! /usr/bin/env python3 import serial ser=serial.Serial("/dev/serial0",115200) print(ser.name) ser.write('This is a test\r\n'.encode('ascii')) ser.close 

It is far from clear what you have connected, what OS, what code you are actually using or how you installed modules.

No module named 'serial' means the code won't compile because you haven't installed it.

Normally you would install with sudo apt install python3-serial.

Even if you fix the code it won't work as /dev/ttyAMA0 is connected to Bluetooth on most Pi, but it certainly isn't "a TTY to USB converter".

See How do I make serial work on the Raspberry Pi3 or later

It is far from clear what you have connected, what OS, what code you are actually using or how you installed modules.

No module named 'serial' means the code won't compile because you haven't installed it.

Normally you would install with sudo apt install python3-serial.

Even if you fix the code it won't work as /dev/ttyAMA0 is connected to Bluetooth on most Pi, but it certainly isn't "a TTY to USB converter".

See How do I make serial work on the Raspberry Pi3 or later

The following is a simple test program (not elegant python) that works on the Pi default serial port.

#! /usr/bin/env python3 import serial ser=serial.Serial("/dev/serial0",115200) print(ser.name) ser.write('This is a test\r\n'.encode('ascii')) ser.close 
added 81 characters in body
Source Link
Milliways
  • 63k
  • 33
  • 114
  • 228

It is far from clear what you have connected, what OS, what code you are actually using or how you installed modules.

No module named 'serial' means the code won't compile because you haven't installed it.

Normally you would install with sudo apt install python3-serial.

Even if you fix the code it won't work as /dev/ttyAMA0 is connected to Bluetooth on most Pi, but it certainly isn't "a TTY to USB converter".

See How do I make serial work on the Raspberry Pi3 or later

It is far from clear what you have connected, what OS, what code you are actually using or how you installed modules.

No module named 'serial' means the code won't compile because you haven't installed it.

Even if you fix the code it won't work as /dev/ttyAMA0 is connected to Bluetooth on most Pi, but it certainly isn't "a TTY to USB converter".

See How do I make serial work on the Raspberry Pi3 or later

It is far from clear what you have connected, what OS, what code you are actually using or how you installed modules.

No module named 'serial' means the code won't compile because you haven't installed it.

Normally you would install with sudo apt install python3-serial.

Even if you fix the code it won't work as /dev/ttyAMA0 is connected to Bluetooth on most Pi, but it certainly isn't "a TTY to USB converter".

See How do I make serial work on the Raspberry Pi3 or later

Source Link
Milliways
  • 63k
  • 33
  • 114
  • 228

It is far from clear what you have connected, what OS, what code you are actually using or how you installed modules.

No module named 'serial' means the code won't compile because you haven't installed it.

Even if you fix the code it won't work as /dev/ttyAMA0 is connected to Bluetooth on most Pi, but it certainly isn't "a TTY to USB converter".

See How do I make serial work on the Raspberry Pi3 or later