From 9c63d798d011040c586251546177e96cfb3187bd Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Thu, 27 Aug 2020 10:49:38 +0200 Subject: [PATCH 1/2] comment and readme --- snippets/snippet1.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/snippets/snippet1.py b/snippets/snippet1.py index 986cd3d..edb281c 100644 --- a/snippets/snippet1.py +++ b/snippets/snippet1.py @@ -112,6 +112,8 @@ class MeterbusSerial(object): self.port.write(msg) + # FIXME: Attention, the actual write time of the interface is not considered. + # This is a measured value. sleep(0.030) frontendHold() @@ -128,6 +130,7 @@ class MeterbusSerial(object): expectedUserDataOctets = 0 state = MeterbusResponseStates.START1 while (state not in [MeterbusResponseStates.DONE, MeterbusResponseStates.ERROR]): + print("Waiting for input ... ") c = self.port.read() print("State {}, Octet {}".format(state, c)) From f31af7608e0e9ca66455806f65f34525ae1c9c78 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Thu, 27 Aug 2020 10:50:28 +0200 Subject: [PATCH 2/2] forgotten readme --- readme.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 readme.md diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..95bf7f4 --- /dev/null +++ b/readme.md @@ -0,0 +1,26 @@ +## Disable the serial console, disable bluetooth and disable the hciuart service: + +https://www.raspberrypi.org/documentation/configuration/uart.md +https://www.raspberrypi.org/forums/viewtopic.php?t=178071 + + +### Disable hciuart and other bluetooth related services: +* `systemctl disable hciuart` +* `systemctl disable bluealsa` +* `systemctl disable bluetooth` + +### Disable serial console: +* Check `/boot/cmdline.txt` +* Comment line `console=serial0,115200` or `console=ttyAMA0,115200` or similar + +### Disable bluetooth +* Add `dtoverlay=pi3-disable-bt` to `/boot/config.txt` + + + +## Serial port configuration in Python: + +https://pythonhosted.org/pyserial/shortintro.html#opening-serial-ports + +Consider a timeout! +