Merge branch 'master' of ssh://home.hottis.de:2922/wolutator/mbus-gateway

This commit is contained in:
2020-08-29 11:50:47 +01:00
2 changed files with 29 additions and 0 deletions

26
readme.md Normal file
View File

@ -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!

View File

@ -114,6 +114,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()
@ -130,6 +132,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))