-
Notifications
You must be signed in to change notification settings - Fork 3
Step 5 The HAT interface
The HAT interface is primarily a software module that supports the raspberry's GPIO pins for keys, an LCD screen, and an infrared (IR) interface.
To enable the interface, type sudo systemctl enable pypilot_hat
.
To make it work without the hat arduino, edit /etc/systemd/system/pypilot_hat.service
and change '44444' into 'none'
Then it should look like this:
pi@openplotter:~/pypilot $ pypilot_hat none
have gpio for raspberry pi
loading config file: /home/pi/.pypilot/hat.conf
failed to load /proc/device-tree/hat/custom_0 : [Errno 2] No such file or directory: '/proc/device-tree/hat/custom_0'
overriding driver default to command line none
arduino process on 28138
renice: failed to set priority for 28138 (process ID): Permission denied
warning, failed to renice hat arduino process
No hat config, arduino not found
28139 (process ID) old priority 0, new priority 19
(30 seconds pause)
web process 28139
web config {'remote': False, 'host': 'pypilot', 'actions': {'auto': [], 'menu': [], 'up': [], 'down': [], 'select': [], 'left': [], 'right': [], 'engage': ['gpio18'], 'disengage': ['gpio23'], '1': [], '-1': [], '2': [], '-2': [], '10': [], '-10': [], 'compassmode': [], 'gpsmode': [], 'windmode': [], 'tackport': [], 'tackstarboard': []}, 'pi.ir': False, 'arduino.ir': False, 'arduino.nmea.in': False, 'arduino.nmea.out': False, 'arduino.nmea.baud': 4800, 'lcd': {'contrast': 60, 'invert': False, 'backlight': 200, 'flip': False, 'language': 'en', 'bigstep': 10, 'smallstep': 1, 'remote': False, 'hue': 27}}
web process on port 33333
web client connected c9fb01fcb0ac415a91e56d8432098268
apply ('gpio23', 1) 168451.776421598
apply ('gpio23', 2) 168451.776693334
apply ('gpio23', 0) 168451.776797443
The pypilot_hat software module can be manually configured by editing ~/.pypilot/hat.conf. For instance, if you don't have an infrared sensor, set pi.ir to False in this file.
This pypilot_hat software module also provides a web interface at socket :33333 that can be used to configure these same things. Note that the web interface at port :33333 has a startup delay of 30 seconds.
Moreover, the pypilot_hat software module can also connect to an extra arduino that provides a RF433 wireless remote, NMEA0183 I/O and a buzzer. This extra arduino would need to be programmed with the hat.ino sketch. The reference schematics for this hardware is at https://pypilot.org/schematics/pypilot_tinypilot.pdf.
A few notes to interpret this diagram:
- The communication between this extra HAT arduino and the raspberry is the MISO and MOSI signals.
- The RF433 module comes in at J9, pin2, as DATA and connects to the HAT arduino on PD2.
The reason for this extra arduino is to offload the raspberry. Besides, the signal that comes out the RF433 module is serial, but too long in term of bits and too non-standard to be handled by a standard UART. It needs to be sampled (as in bitbanging) and there is no way the raspberry could do that as well.
Pypilot Workbook
- Introduction
- What is pypilot
- The software component
- The hardware component
- The User Interface component
- Pypilot functions
- Data connections
-
The steps
- OLD
- Step 1: Install Openplotter Headless
- Step 2: Install pypilot
- Step 3: The openplotter user interface
- Step 4: The browser interface
- Step 5: The HAT interface
- Step 6: The Arduino controller
- Step 7: OpenCPN Pypilot Plugin
- Step 8: Looking under the hood
- Step 9: Wiring up the Nano
- Step 10: Installing Tinypilot
- Step 11: Tinypilot under the hood
- Step 12: Using openplotter tools remotely
- Step 13: SignalK connections
- Step 14: The Pypilot Motor Controller
- Step 15: Understanding motor.ino
- Parameters
- Gains
- NEW
- Step 1: Installing pypilot
- Step 2: Web interface
- Step 3: OpenCPN pypilot plugin
- Step 4: Installing the arduino
- Step 5: Wiring the arduino
- Step 6: Setting up data connections
- Step 7: SignalK connections
- Step 8: HAT interface
- Step 9: Debian under the hood
- Step 10: Tinypilot under the hood
- Step 11: Openplotter details
- Updating pypilot: debian
- Updating pypilot: tinypilot
- Feedback
- Todo
- Finally
- Autopilot Route Plugin
- Watchdog
- Workbook Release Notes