4. Using the HAT - mr-rooney/moitessier GitHub Wiki
- Raspberry Pi with preinstalled Raspbian (or similar distribution)
- Mounted HAT (with programmed ID EEPROM)
- Installed Moitessier debian package
pi> cat /dev/moitessier.tty
or
pi> cat /dev/moitessier.spi
The simulator can be used to test the communication between Raspberry Pi and HAT without receiving real AIS signals. The HAT will generate two simulated AIS targets in the Mediterranean Sea.
- To enable the simulator you must set the appropriate configuration in the config.xml file:
pi> nano ~/moitessier/app/moitessier_ctrl/config.xml
- Change the relevant parameters in section <simulator>
- Write the configuration to the HAT:
pi> cd ~/moitessier/app/moitessier_ctrl/ && ./moitessier_ctrl /dev/moitessier.ctrl 5 config.xml
You might want to change the receiver settings (e.g. receiving frequency, automatic frequency control range, etc.) for testing purpose.
- Modify the parameters in section <receiver> of the config.xml file:
pi> nano ~/moitessier/app/moitessier_ctrl/config.xml
- Write the configuration to the HAT:
pi> cd ~/moitessier/app/moitessier_ctrl/ && ./moitessier_ctrl /dev/moitessier.ctrl 5 config.xml
Statistics
pi> cd ~/moitessier/app/moitessier_ctrl/ && ./moitessier_ctrl /dev/moitessier.ctrl 0
Device information
pi> cd ~/moitessier/app/moitessier_ctrl/ && ./moitessier_ctrl /dev/moitessier.ctrl 1
AIS LED
- LED switched on: No AIS data reception
- LED flashing at variable/inconsistent frequency: AIS data is received
GNSS LED
- LED switched on: No GNSS fix
- LED flashing once per second: GNSS fix
ERROR LED
- LED switched off: No error occurred
- LED flashing at variable/inconsistent frequency: Internal buffer overflows (the data is processed too slowly by the Raspberry Pi)
- LED flashing at consistent frequency: system error (read the device information to get system error code)
If the ERROR LED is flashing at a consistent frequency, you can get the system error code by reading the device information (as described above). System errors might occur during hardware initialization and indicate mainly a defective hardware. The error code is a bit mask:
- Bit 0: GNSS failed
- Bit 1: AIS receiver 1 failed
- Bit 2: AIS receiver 2 failed
- Bit 3: SPI host interface failed
- Bit 4: UART host interface failed
e.g. system errors = 0x00000011 --> GNSS and UART host interface failed