initial
This commit is contained in:
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "rpirtscts"]
|
||||||
|
path = rpirtscts
|
||||||
|
url = https://github.com/mholling/rpirtscts
|
34
readme.md
Normal file
34
readme.md
Normal file
@ -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'))
|
||||||
|
|
||||||
|
|
1
rpirtscts
Submodule
1
rpirtscts
Submodule
Submodule rpirtscts added at 612b065e38
Reference in New Issue
Block a user