commit c0d5aa283837bdb4fd7ab6c6e51b170277d02b4a Author: Wolfgang Hottgenroth Date: Mon Jun 10 19:45:25 2019 +0100 initial diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..2b2cb1c --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "rpirtscts"] + path = rpirtscts + url = https://github.com/mholling/rpirtscts diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..15b0900 --- /dev/null +++ b/readme.md @@ -0,0 +1,34 @@ +# modbusmaster + +## Disable Bluetooth on RPi3 + +Add at the end of `/boot/config`: + + dtoverlay=pi3-disable-bt + +Remove mentions of `serial0` from `/boot/cmdline`. + + +## Enable rs485 mode + +Use the submodule rpirtscts to enable to alternate functions of the related +pins at the RPi MCU. It is submoduled here, can be found directly at https://github.com/mholling/rpirtscts + + cd rpirtscts + gcc -o rpirtscts rpirtscts.c + sudo ./rpirtscts on + +This needs to be done at every boot. + +Kudos to danjperron, cmp. (https://www.raspberrypi.org/forums/viewtopic.php?f=98&t=224533&hilit=rs+485#p1383709) + + + +## Python snippet to test + + import serial.rs485 + ser=serial.rs485.RS485(port='/dev/ttyAMA0',baudrate=9600) + ser.rs485_mode = serial.rs485.RS485Settings(False,True) + ser.write('a test'.encode('utf-8')) + + diff --git a/rpirtscts b/rpirtscts new file mode 160000 index 0000000..612b065 --- /dev/null +++ b/rpirtscts @@ -0,0 +1 @@ +Subproject commit 612b065e3832888d024e2bbd6d48c381a42bfbba