Posts: 26
Threads: 4
Joined: Jun 2019
Reputation:
1
Thanks Sean for your feedback!
When I run scriptarduino.py, I do get a response when I press the buttons on the remote control!
Code: tc@pypilot:/mnt/mmcblk0p2/tinypilot/pypilot/hat$ sudo python3 arduino.py
initializing arduino
arduino on spidev0.1
nmea set baud [5]
[['voltage', {'vcc': 1.147, 'vin': 3.273}]] 192.696803 192.696803
[['voltage', {'vcc': 1.155, 'vin': 3.273}]] 197.818791 5.121988000000016
hat firmware version 1.2
[['version', '1.2']] 202.636867 4.818075999999991
[['voltage', {'vcc': 1.167, 'vin': 3.273}]] 202.90993 0.2730630000000076
baud rate TX: 0.0 RX 0.0
[['voltage', {'vcc': 1.145, 'vin': 3.273}]] 207.943154 5.03322399999999
[['voltage', {'vcc': 1.133, 'vin': 3.273}]] 213.077411 5.134257000000019
baud rate TX: 0.0 RX 0.0
[['rf18750340', 1]] 215.64784 2.57042899999999
[['rf18750340', 2]] 215.75385 0.10600999999999772
[['rf18750340', 3]] 215.993244 0.23939400000000433
[['rf18750340', 4]] 216.288505 0.29526099999998223
[['rf18750340', 5]] 216.517617 0.22911200000001486
[['rf18750340', 0]] 216.82859 0.31097299999998995
[['rf14750340', 1]] 216.924455 0.09586500000000342
[['rf14750340', 2]] 217.133263 0.20880800000000477
[['rf14750340', 3]] 217.38271 0.24944700000000353
[['rf14750340', 0]] 217.673291 0.2905810000000031
[['rf12750340', 1]] 217.717742 0.04445099999998092
[['rf12750340', 2]] 217.927131 0.2093890000000158
[['rf12750340', 0]] 218.238489 0.31135799999998426
[['rf1C750340', 1]] 218.334276 0.0957870000000014
[['rf1C750340', 2]] 218.49188 0.1576040000000205
[['rf1C750340', 0]] 218.802646 0.310766000000001
[['rf1C750340', 1]] 219.103274 0.300627999999989
[['rf1C750340', 2]] 219.337265 0.23399100000000317
[['rf1C750340', 3]] 219.535599 0.19833399999998846
[['rf1C750340', 0]] 219.8262 0.29060100000000944
Why, then, does it not work in normal use? For my tests at home the MPU inertial sensor is not connected because it is installed on my boat. Could the absence of the sensor explain my problems?
Posts: 26
Threads: 4
Joined: Jun 2019
Reputation:
1
Here is where I’m at:
1 – I know my ATMEGA is correctly flashed and wired to the RPi and the RXB6. The arduino.py script works very well (I’m pleasantly surprised by the range even without an antenna!) and it correctly reports my button presses, for example code rf18750340.
2 – But pypilot_hat itself is not working correctly. Even though the RPi and Arduino seem to communicate when it is running (the small SPI activity LED blinks in the same way as when arduino.py is running), the information does not reach pypilot. On the pypilot.io:33333 page, when I click on a function, for example “standby”, I always get the dialog “clear all codes for ‘standby’?” and it never records the button from my remote. My understanding was that the expected behavior is: click on a function in the web interface, then press a button on the remote, and that button code is stored. That is not happening here.
To work around this, I manually edited the hat.conf file directly on the SD card and added the code rf18750340 for the “engage” function. After that, rf18750340 does appear on the TinyPilot web interface at startup for “engage”, but pressing that button on the remote does not trigger any action.
In the logs, whether for pypilot or pypilot_hat, there is never any reference to rf18750340 or any RF reception at all.
So I conclude that the problem is software, somewhere in the communication between arduino.py (Arduino/HAT side) and the rest of pypilot.
3 – I brought my IMU back from the boat to test if it would work with the IMU connected. The answer is no.
4 – So I’m completely stuck. It’s quite frustrating because it feels like I’m really close to having it working… This is driving me crazy!
I suspect my homemade HAT is causing a compatibility issue somewhere. The differences are:
No EEPROM in my design. Is there some file or configuration needed to compensate for that?
No LCD screen. Could the missing LCD be causing a bug? I’m hesitating to buy a screen, but if that’s not the issue it’s more time and money for nothing. I decided to build my own TinyPilot because I couldn’t find complete units anymore (Navitop was only selling motor controllers at that time). If there is no solution I’ll probably give up and buy a unit from Navitop. I’d really prefer to get my own build working because I already bought the parts, the hardware integration fits nicely in my boat, and I like the satisfaction of making it work myself instead of feeling like I had to give up…
Am I the only one who has built a setup with only an Arduino RF receiver and no LCD? Any hints so I can move forward?
Here is my hat.conf:
Code: {"host":"localhost","actions":{"-10_":["ir03111800","ir03111000","KEY_LEFT","gpio06","rf3F402350","rf3F405350"],"-1_":["ir03201800","ir03201000","KEY_UP","gpio27","rf77082350","rf77085350"],"+1_":["ir03211800","ir03211000","KEY_DOWN","gpio22","rf7B042350","rf7B045350"],"+10_":["ir03101800","ir03101000","KEY_RIGHT","gpio05","rf5F202350","rf5F205350"],"auto_":["ir030C1000","ir030C1800","KEY_POWER","gpio17","rf7E012350","rf7E015350"],"menu_":["ir030D1000","ir030D1800","KEY_MUTE","gpio23","rf7D022350","rf7D025350"],"mode_":["ir030B1000","ir030B1800","KEY_SELECT","gpio18","rf6F102350","rf6F105350"],"-1":["rf77082950","rf77085950"],"+1":["rf7B042950","rf7B045950"],"-10":["rf3F402950","rf3F405950"],"+10":["rf5F202950","rf5F205950"],"tack port":["gpio27_06","rf37482950","rf37485950","rf37482350","rf37485350"],"tack starboard":["gpio22_05","rf5B242950","rf5B245950","rf5B242350","rf5B245350"],"standby":["rf7E012950","rf7E015950"],"engage":["rf18750340"],"compass mode":["rf7D022950","rf7D025950"],"gps mode":["rf6F102950","rf6F105950"],"nav mode":["rf6D122950","rf6D125950"],"wind mode":["rf7F002930","rf7F005930"],"true wind mode":["rf6F102930","rf6F105930"],"pilot absolute":[],"pilot basic":[]},"arduino.adc_channels":[null],"pi.ir":false,"arduino.ir":true,"arduino.nmea.in":false,"arduino.nmea.out":false,"arduino.nmea.baud":4800,"lcd":{},"hat":{"lcd":{"driver":"default","port":"\/dev\/spidev0.0"},"lirc":"gpio4"},"modes":["compass","gps","nav","wind","true wind"]}
Posts: 202
Threads: 9
Joined: Sep 2020
Reputation:
7
2025-12-14, 11:48 PM
(This post was last modified: 2025-12-14, 11:54 PM by Jean-Marc Douroux.)
It sounds like you're clicking on the function in the list before pressing the button on the remote you want to associate with that function.
First, press a button on the remote control and check that the code appears on the configuration screen of pypilot web server. Once the code is displayed, you can select the function from the list to assign to the button.
Are you using a 433MHz rolling code or learning code remote control? If not, no code will be sent to pypilot. It's best to use a remote control with an EV1527 chip.
When Pypilot has not received the unique rolling code from a remote control button, it is normal for it to offer the "clear all codes" option for the function that was clicked in the list.
Posts: 26
Threads: 4
Joined: Jun 2019
Reputation:
1
(2025-12-14, 11:48 PM)Jean-Marc Douroux Wrote: It sounds like you're clicking on the function in the list before pressing the button on the remote you want to associate with that function.
First, press a button on the remote control and check that the code appears on the configuration screen of pypilot web server. Once the code is displayed, you can select the function from the list to assign to the button.
Are you using a 433MHz rolling code or learning code remote control? If not, no code will be sent to pypilot. It's best to use a remote control with an EV1527 chip.
When Pypilot has not received the unique rolling code from a remote control button, it is normal for it to offer the "clear all codes" option for the function that was clicked in the list.
Whether the remote is pressed before or after clicking, the result is the same: the web page does not show any indication that a button has been pressed.
I am trying classic 433 MHz remotes, both the one bought for the tinypilot and the one from my apartment building’s garage door. I can see both of them clearly in the shell output of the arduino.py script, but nothing happens when using the pypilot_hat service.[url=https://pypilot.org/doc/pypilot_user_manual/][/url]
This leads me to think that the absence of a screen might be preventing the pypilot_hat service from working correctly, although this is only a supposition.
Posts: 202
Threads: 9
Joined: Sep 2020
Reputation:
7
Why didn't you declare the "resetpin" pin in the config.hat file, especially since you're not using the same GPIO pins as Sean's computers in recent years?
Was this intentional?
In the config.hat file of Sean's last image, there is "resetpin":16
Posts: 26
Threads: 4
Joined: Jun 2019
Reputation:
1
(2025-12-15, 03:38 PM)Jean-Marc Douroux Wrote: Why didn't you declare the "resetpin" pin in the config.hat file, especially since you're not using the same GPIO pins as Sean's computers in recent years?
Was this intentional?
In the config.hat file of Sean's last image, there is "resetpin":16
Jean Marc, could you explain what the config.hat file is? I don’t know how to declare the pins. I’ve configured the reset on GPIO 26 as Sean suggested.
I also read that you can set lcd=none, but I don’t understand where this should be done.
Is there any document that explains how to enter these settings?
Posts: 202
Threads: 9
Joined: Sep 2020
Reputation:
7
The file hat.conf is in the directory .pypilot of the SD card. You need a linux machine to viewed and modified this directory and his files
If you only have a PC, you can use the free application "Linux File Systems for Windows by Paragon Software", which allows you to mount Linux disks in Windows to view and modify them.
When finished, you need to "unmount" the SD card within this application.
Here is the content of the hat.conf file in Sean's image. HATs with an EEPROM can automatically configure this file based on the HAT's hardware. Without an EEPROM, it must be configured manually.
{"host":"localhost","actions":{"-10_":["ir03111800","ir03111000","KEY_LEFT","gpio06","rf3F402350","rf3F405350"],"-1_":["ir03201800","ir03201000","KEY_UP","gpio27","rf77082350","rf77085350"],"+1_":["ir03211800","ir03211000","KEY_DOWN","gpio22","rf7B042350","rf7B045350"],"+10_":["ir03101800","ir03101000","KEY_RIGHT","gpio05","rf5F202350","rf5F205350"],"auto_":["ir030C1000","ir030C1800","KEY_POWER","gpio17","rf7E012350","rf7E015350"],"menu_":["ir030D1000","ir030D1800","KEY_MUTE","gpio23","rf7D022350","rf7D025350"],"mode_":["ir030B1000","ir030B1800","KEY_SELECT","gpio18","rf6F102350","rf6F105350"],"-1":["rf77082950","rf77085950","rf481C4A20","rf08721C60"],"+1":["rf7B042950","rf7B045950","rf441C4A20","rf04721C60"],"-10":["rf3F402950","rf3F405950","rf4C1C4A20","rf0C721C60"],"+10":["rf5F202950","rf5F205950","rf421C4A20","rf02721C60"],"tack port":["gpio27_06","rf37482950","rf37485950","rf37482350","rf37485350"],"tack starboard":["gpio22_05","rf5B242950","rf5B245950","rf5B242350","rf5B245350"],"standby":["rf7E012950","rf7E015950","rf471C4A20","rf07721C60"],"engage":["rf4F1C4A20","rf0F721C60"],"compass mode":["rf7D022950","rf7D025950"],"gps mode":["rf6F102950","rf6F105950"],"nav mode":["rf6D122950","rf6D125950"],"wind mode":["rf7F002930","rf7F005930"],"true wind mode":["rf6F102930","rf6F105930"],"pilot absolute":[],"pilot basic":[]},"arduino.adc_channels":[],"pi.ir":false,"arduino.ir":true,"arduino.nmea.in":false,"arduino.nmea.out":false,"arduino.nmea.baud":"38400","lcd":{"contrast":59.609294879999545,"invert":false,"backlight":12.77888591999178,"flip":false,"language":"en","bigstep":10,"smallstep":1,"hue":214,"buzzer":1.588708112000046,"buzzer_pitch":2},"command":"touch \/home\/tc\/t","remote":false,"hat":{"mpu":{"driver":"icm20948","port":"\/dev\/i2c-1"},"lcd":{"driver":"jlx12864","port":"\/dev\/spidev0.0"},"arduino":{"device":"\/dev\/spidev0.1","resetpin":16,"hardware":0.23},"lirc":"gpio4"},"modes":["compass","gps","nav","wind","true wind"],"arduino_firmware_version_available":"1.2","arduino_firmware_version":"1.2"}
Posts: 26
Threads: 4
Joined: Jun 2019
Reputation:
1
(2025-12-16, 01:54 PM)Jean-Marc Douroux Wrote: The file hat.conf is in the directory .pypilot of the SD card. You need a linux machine to viewed and modified this directory and his files
If you only have a PC, you can use the free application "Linux File Systems for Windows by Paragon Software", which allows you to mount Linux disks in Windows to view and modify them.
When finished, you need to "unmount" the SD card within this application.
Here is the content of the hat.conf file in Sean's image. HATs with an EEPROM can automatically configure this file based on the HAT's hardware. Without an EEPROM, it must be configured manually.
{"host":"localhost","actions":{"-10_":["ir03111800","ir03111000","KEY_LEFT","gpio06","rf3F402350","rf3F405350"],"-1_":["ir03201800","ir03201000","KEY_UP","gpio27","rf77082350","rf77085350"],"+1_":["ir03211800","ir03211000","KEY_DOWN","gpio22","rf7B042350","rf7B045350"],"+10_":["ir03101800","ir03101000","KEY_RIGHT","gpio05","rf5F202350","rf5F205350"],"auto_":["ir030C1000","ir030C1800","KEY_POWER","gpio17","rf7E012350","rf7E015350"],"menu_":["ir030D1000","ir030D1800","KEY_MUTE","gpio23","rf7D022350","rf7D025350"],"mode_":["ir030B1000","ir030B1800","KEY_SELECT","gpio18","rf6F102350","rf6F105350"],"-1":["rf77082950","rf77085950","rf481C4A20","rf08721C60"],"+1":["rf7B042950","rf7B045950","rf441C4A20","rf04721C60"],"-10":["rf3F402950","rf3F405950","rf4C1C4A20","rf0C721C60"],"+10":["rf5F202950","rf5F205950","rf421C4A20","rf02721C60"],"tack port":["gpio27_06","rf37482950","rf37485950","rf37482350","rf37485350"],"tack starboard":["gpio22_05","rf5B242950","rf5B245950","rf5B242350","rf5B245350"],"standby":["rf7E012950","rf7E015950","rf471C4A20","rf07721C60"],"engage":["rf4F1C4A20","rf0F721C60"],"compass mode":["rf7D022950","rf7D025950"],"gps mode":["rf6F102950","rf6F105950"],"nav mode":["rf6D122950","rf6D125950"],"wind mode":["rf7F002930","rf7F005930"],"true wind mode":["rf6F102930","rf6F105930"],"pilot absolute":[],"pilot basic":[]},"arduino.adc_channels":[],"pi.ir":false,"arduino.ir":true,"arduino.nmea.in":false,"arduino.nmea.out":false,"arduino.nmea.baud":"38400","lcd":{"contrast":59.609294879999545,"invert":false,"backlight":12.77888591999178,"flip":false,"language":"en","bigstep":10,"smallstep":1,"hue":214,"buzzer":1.588708112000046,"buzzer_pitch":2},"command":"touch \/home\/tc\/t","remote":false,"hat":{"mpu":{"driver":"icm20948","port":"\/dev\/i2c-1"},"lcd":{"driver":"jlx12864","port":"\/dev\/spidev0.0"},"arduino":{"device":"\/dev\/spidev0.1","resetpin":16,"hardware":0.23},"lirc":"gpio4"},"modes":["compass","gps","nav","wind","true wind"],"arduino_firmware_version_available":"1.2","arduino_firmware_version":"1.2"}
Thank you so much Jean Marc!
I had already figured out how to access hat.conf, but I didn't have such a complete configuration example! On my TinyPilot I do have the basic hat.conf without EEPROM reading and it's much less detailed than yours!
I can see that I'm clearly missing the line: "arduino":{"device":"\/dev\/spidev0.1","resetpin":16,"hardware":0.23}
As soon as I get home this weekend I'll run the test. Your information gives me good hope. I still have one question: what does "hardware" correspond to?
Posts: 202
Threads: 9
Joined: Sep 2020
Reputation:
7
2025-12-16, 03:27 PM
(This post was last modified: 2025-12-16, 04:14 PM by Jean-Marc Douroux.)
It's the Sean's hat version when he makes the image.
This is normally updated by the EEPROM of the HATs sold by Sean, but it's not necessary for the autopylot to function. It can be left as is.
Remember that "resetpin" must be configured according to the GPIO pin of the Pi used with your Arduino. It seems to me that you may not have used the GPIO pin used by Sean's recent HATs
Posts: 26
Threads: 4
Joined: Jun 2019
Reputation:
1
It’s working now!
It turns out that the line
"arduino":{"device":"/dev/spidev0.1","resetpin":26,"hardware":0.23}
must be present for the pypilot_hat script to communicate properly with the Arduino.
Many thanks to Jean-Marc for the crucial tip!
I’ve also noticed that the range without an antenna is better than I expected, but still not reliable — beyond about 3 meters the connection becomes unstable.
Looks like I’ll need to add an antenna. Does anyone know how the antennas are implemented on the official HAT?
|