2023-08-21, 04:51 AM
Hello all,
My overall experience: It’s cool, and I can certainly see a use for this, but it’s not 100% of what I was hoping it would be, and it was a bit more expensive than I thought. My cost data and notes for each item are in the attached Word Doc below. My biggest gripe is screen brightness. I wish I had listened to others online saying >1000 Nits (aka: cd/m2) is an absolute requirement for sunlight readable. They are correct. I can barely see this screen. Also the polarization angle of the waveshare screen means that I cannot see it with polarized sunglasses on. My next screen (maybe) will consider both of these things.
4. To set hardware keys;
#add to very bottom
5. To prevent RPi from being annoying with the high power RTL-SDR:
6. To set I2C Current sensors
Take a look at my build, and let me know what you think. Photos are below. I’m a hobby fisherman out of Rhode Island on a 22’ Center Console, and so my experience it a bit different than many of the sailors on this forum. My criteria was that the unit would be self-contained, and 100% waterproof.
Backstory: After looking at the prices for a commercially available 10"+ touchscreen chart plotter which could "do it all", I googled “DIY Chart Plotter” and stumbled upon OpenPlotter about a month ago. I read the docs, browsed this forum a bit and decided to do a build for myself. Coming with no “software development” background, I have found it to be moderately easy to setup so-far. I have re-wired my boat and am very comfortable with 12vdc systems. I have tinkered with Arduino before, but have never done a raspberry pi project. I regularly use windows as a part of my job, but my use of linux/coding experience is limited. If you’re comfortable googling, then you should be 95% OK. I’m guessing that these forums can help with the remaining 5% of questions. I dabble in ham radio, and like the fact that I can use this box with GQRX as a field day kit.
My Setup: My RPi is mounted to a waveshare 10.1” DSI LCD screen and connected via DSI for video, and POGO pins for power and touch via I2C. This screen is effectively designed for use with RPi. The waveshare screen is pretty neat, if not for its low overall brightness. The screen is glued into the project box enclosure using 3m4200 adhesive sealant. I have a DPDT switch which allows the RPi to be powered from either the internal 12v “JumpPack”, or from switched 12VDC boat power. In either position, the Jump Pack is charged from the boat’s 12VDC “house” battery.
95% of my setup/debugging usage so far has been on solely battery power. The Jump Pack is rated for 12VDC, but in actuality it’s about 16.2VDC when fully charged, and 12.7VDC when nearly dead. I validated this by checking the illuminated state of charge indicator on the jump pack at various points and built a power profile based on voltage. I monitor voltage, power, and current of both the jump pack and boat’s 12VDC “house” battery via adafruit INA260 boards, import data via OpenPlotter’s I2C app, send it to Signal K, and can monitor all 6 parameters on the signal K Instrument Panel Dashboard. I (believe) I set up OpenPlotter’s notifications to give me a warning when the internal jump pack drops below 13.7vdc, and an emergency shutdown when the voltage drops below 12.7VDC.
My “Custom Hat”: Touchscreens don’t always work when wet or fish slime covered hands, and I really like physical push buttons. I built my box with 8 physical pushbuttons for ZoomIn (OpenCPN shortcut key PgUp), ZoomOut (PgDn), Pan up (UpArrow), Pan down (DownArrow), Pan left (LeftArrow), Pan right (RightArrow), AutoFollow (“F2”), and Shutdown (Openplotter’s Shutdown GPIO). I use dtoverlay GPIO-Key to send keystrokes to the system when each pin goes to ground. Instead of keeping jumper wires precarious placed inside of my box, I decided to buy some RPi prototyping boards and solder everything up. I’ve been reviewing OpenPlotter / Open Marine’s upcoming McArthur hat, and I selected GPIO pins which were not planned for use on the McArthur hat.
mbTiles: I spent a couple days figuring out mbTiles, and it is awesome. All you need to know is here. Having Navionics SonarCharts AND locally saved google maps satellite view in my area is fantastic. I have previously purchased Navionics charts, and was sad to hear that they are locked in to the big chartplotter manufacturers. Neither the NOAA ENC nor RNC charts for my area include a locally dredged channel around the back side of an island. Having access to this channel saves 20 minutes of fuel getting out to good fishing spots. I always navigated it by eye, but having the charts and satellite view for it is fantastic. I strongly recommend you spend the 2 days to figure these out.
Configuration problems still outstanding:
· I can’t figure out how to get GPS data flowed to my radio, and DSC location data flowed to signal K / OpenCPN. I anticipate I have a Signal K setup issue somewhere. I’m working on this.
· Brightness: Neither the Waveshare backlight app, nor rpi-backlight seem to work for this screen. I was successfully able to change brightness in terminal, but the apps don’t work. I’m unsure why. I’m working on this.
Lessons learned:
· NITs = cd/m2 must be >1000 to be sunlight readable.
· Raspberry Pi’s are very finicky about losing power. I believe I “partially corrupted” my SSD card 3 or 4 times over my build. Having a STRONG power supply is needed.
· Installing other RPi libraries can screw up OpenPlotter. The most common “OK, it’s only slightly corrupted, but now I need to rebuild the whole thing again” issue I saw was that I2C data would freeze in signal K. If this starts to happen, you screwed something up in libraries / coding. Good luck fixing it.
· Once you have everything where you want it, use the SD card copier tool to backup your configuration.
Future Plans / Feature Requests:
· I have trouble hearing in general, and I especially have trouble hearing my VHF radio over the noise of my 2-stroke outboard. I would love to add to my OpenPlotter build an offline (no internet connected) Speech to text engine which transcribes and time-based logs all radio transmissions. I started looking into Mozilla Deepspeech for RPi and/or Spchcat for RPi and/or sopare, and tried to overlay them on top of the standard OpenPlotter RPi .iso image, but I ended up breaking things. It installed libraries which caused failure of some core OpenPlotter elements. I do not understand enough coding to get it to work. I wired the VHF radio “external Speaker” pins into the waterproof bulkhead connector in my box. I have a USB microphone-in sound card, and I can solder the external speaker pins to a standard 3.5mm audio jack. I already have my radio set to Scan marine VHF channels 09, 13, 16, 22, 68, & 69, and it sends the audio to both the built-in speaker and the “external Speaker” pins simultaneously. I can envision an RPi app which transcribes the text and puts it into a running long. I’m unsure if the RPi4 (4GB) has the processing power to run openplotter, and this simultaneously. The dream would be to have it also record the VHF channel from which the audio was transcribed, but I don’t think that my radio sends NMEA data for the radio channel for each transmission.
· I can’t figure out how to get GPS data flowed to my radio, and DSC location data flowed to signal K / OpenCPN. I anticipate I have a Signal K setup issue somewhere. I’m working on this.
· Brightness: Neither the Waveshare backlight app, nor rpi-backlight seem to work for this screen. I was successfully able to change brightness in terminal, but the apps don’t work. I’m unsure why. I’m working on this.
Lessons learned:
· NITs = cd/m2 must be >1000 to be sunlight readable.
· Raspberry Pi’s are very finicky about losing power. I believe I “partially corrupted” my SSD card 3 or 4 times over my build. Having a STRONG power supply is needed.
· Installing other RPi libraries can screw up OpenPlotter. The most common “OK, it’s only slightly corrupted, but now I need to rebuild the whole thing again” issue I saw was that I2C data would freeze in signal K. If this starts to happen, you screwed something up in libraries / coding. Good luck fixing it.
· Once you have everything where you want it, use the SD card copier tool to backup your configuration.
Future Plans / Feature Requests:
· I have trouble hearing in general, and I especially have trouble hearing my VHF radio over the noise of my 2-stroke outboard. I would love to add to my OpenPlotter build an offline (no internet connected) Speech to text engine which transcribes and time-based logs all radio transmissions. I started looking into Mozilla Deepspeech for RPi and/or Spchcat for RPi and/or sopare, and tried to overlay them on top of the standard OpenPlotter RPi .iso image, but I ended up breaking things. It installed libraries which caused failure of some core OpenPlotter elements. I do not understand enough coding to get it to work. I wired the VHF radio “external Speaker” pins into the waterproof bulkhead connector in my box. I have a USB microphone-in sound card, and I can solder the external speaker pins to a standard 3.5mm audio jack. I already have my radio set to Scan marine VHF channels 09, 13, 16, 22, 68, & 69, and it sends the audio to both the built-in speaker and the “external Speaker” pins simultaneously. I can envision an RPi app which transcribes the text and puts it into a running long. I’m unsure if the RPi4 (4GB) has the processing power to run openplotter, and this simultaneously. The dream would be to have it also record the VHF channel from which the audio was transcribed, but I don’t think that my radio sends NMEA data for the radio channel for each transmission.
My overall experience: It’s cool, and I can certainly see a use for this, but it’s not 100% of what I was hoping it would be, and it was a bit more expensive than I thought. My cost data and notes for each item are in the attached Word Doc below. My biggest gripe is screen brightness. I wish I had listened to others online saying >1000 Nits (aka: cd/m2) is an absolute requirement for sunlight readable. They are correct. I can barely see this screen. Also the polarization angle of the waveshare screen means that I cannot see it with polarized sunglasses on. My next screen (maybe) will consider both of these things.
My Configuration Notes:
1. To setup screen
o See https://www.waveshare.com/wiki/10.1inch_DSI_LCD_©
o Connect Rpi to the internet either via Ethernet cable or via wifi
o Open terminal
o Connect Rpi to the internet either via Ethernet cable or via wifi
o Open terminal
Code:
git clone https://github.com/waveshare/Waveshare-DSI-LCD
cd Waveshare-DSI-LCD
cd 6.1.21
cd 64
sudo bash ./WS_xinchDSI_MAIN.sh 101C I2C1
§ #Dont forget to change the I2C bus to “1” instead of the default “0” as indicated on the waveshare readme. This allows the waveshare screen POGO pins to connect to the I2C “1” bus for touchscreen.
§ #Wait for a few seconds, when the driver installation is complete
Code:
sudo reboot
o Open terminal§
Code:
sudo nano /boot/config.txt
§ #validate that the above process added the following lines to the bottom of the RPi config file:
·dtoverlay=WS_xinchDSI_Screen,SCREEN_type=8,I2C_bus=1
·dtoverlay=WS_xinchDSI_Touch,I2C_bus=1,invertedx,swappedxy
§ #If the above process added "ignore_lcd=1" to the bottom, delete it.
§ #you should also add to bottom of config.txt the following line to prevent RPi video output squirreliness. This trick took hours to figure out.
Code:
display_default_lcd=1
o Launch Raspberry Pi Imager and under Operating System scroll down to Misc Utilities, Select bootloader, Select Boot from USB if available, otherwise boot from SD Card. Inert SD into RPi, wait until solid green screen.
o This allows you to boot from a USB while setting everything up. Very convenient since I have the RPi “DSI” video ribbon cable in the way of easy access.
o Note; This changes the EPROM, not your SD card, so this is effectively “permanent”. This does add about 20 seconds to boot time if booting from the onboard SD card, and ~10 seconds if booting from USB, but it’s worth it when debugging. You can always flash the EPROM later with the default configuration again.
o Open terminal
Code:
sudo nano /etc/systemd/system.conf
#Uncomment this line "DefaultTimeoutStopSec=90s"
# Change to
DefaultTimeoutStopSec=10s
§ So far it doesn't look like it would impact other services.
4. To set hardware keys;
Code:
#Help; use terminal to get keyboard assignment “keycodes”
sudo showkey
#hit buttons within 10 seconds to get keycode numbers
o Open terminal
Code:
sudo nano /boot/config.txt
Code:
#Set GPIO 6 when grounded to enter keystroke “Left Arrow”
dtoverlay=gpio-key,gpio=6,active_low=1,gpio_pull=up,keycode=105
#Set GPIO 16 when grounded to enter keystroke “F2”(Open CPN F2 =AutoFollow)
dtoverlay=gpio-key,gpio=16,active_low=1,gpio_pull=up,keycode=60
#Set GPIO 17 when grounded to enter keystroke “Right Arrow”
dtoverlay=gpio-key,gpio=17,active_low=1,gpio_pull=up,keycode=106
#Set GPIO 22 when grounded to enter keystroke “Pg up” (Zoom In)
dtoverlay=gpio-key,gpio=22,active_low=1,gpio_pull=up,keycode=104
#Set GPIO 23 when grounded to enter keystroke “Pg Dn” (Zoom Out)
dtoverlay=gpio-key,gpio=23,active_low=1,gpio_pull=up,keycode=109
#Set GPIO 24 when grounded to enter keystroke “Up Arrow”
dtoverlay=gpio-key,gpio=24,active_low=1,gpio_pull=up,keycode=103
#Set GPIO 27 when grounded to enter keystroke “Down Arrow”
dtoverlay=gpio-key,gpio=27,active_low=1,gpio_pull=up,keycode=108
5. To prevent RPi from being annoying with the high power RTL-SDR:
o Open terminal
Code:
sudo nano /boot/config.txt
#add to very bottom
max_usb_current=1
6. To set I2C Current sensors
o Open OpenPlotter I2C App
o Add INA260 @0x40
§ Voltage = Edit signal K Key to electrical.batteries.1.voltage
§ Current = Edit signal K Key to electrical.batteries.1.current
§ Power = Edit signal K Key to electrical.batteries.1
o Add INA260 @0x41
§ Voltage = Edit signal K Key to electrical.batteries.2.voltage
§ Current = Edit signal K Key to electrical.batteries.2.current
§ Power = Edit signal K Key to electrical.batteries.2
7. On openplotter, I prefer the “Clock” on the toolbar to be date format “%c”.