AIS4 transplan my AIS coding from arduino to ESP32
ESP32 is a cheap chip with lot of varities of boards, and good support with community.
The integration is very high:
2 MCU + wifi+BLE on chip, and you can easily find boards with OLED, Lora, beside the serial0 used by bootloader, there are still serial1 and 2 for other connections.
The integrated touch sensor could be used for water prove buttons.
So, I decided to put this program on ESP32 for easier development.
The first trouble I came across is the uart pin selection.
ESP32 has a pin muxing matrix function, so you can almost use any pin you want for your selected function. But there are some pins we should avoid:
Internal connection to flash.
pin related to bootloader.
So, I end up with connecting my GPS on serial1 pin4 as Rx, few modification on serial stuff, code works great...I love arduino!!
https://github.com/Ldsrc2008/AIS-encode-arduino/tree/master/GPS_ESP32_Uart104_make_AIS_sentence
Now I wish to add OLED display for :
Again, I need to check the pins
There are several lib for 1306 OLED I have installed the following 2, they are all included in arduino IDE that I used V1.8.5:
With squix's blog has also some thing interest me a lot...
But...this wemos esp32 OLED board I2C pins are on GPIO 5 and 4 for data and clock respectively.So, I need to move my GPS pin...
I got problem if I wish to add touch sensor....after looking in to all the stuff I have, I need to move again:
Rx1=IO13
TX1=IO16
Rx2=IO25
TX2=IO26
then I could leave me
touch6=IO14
touch3=IO15
The code could work without issue on boot nor download
The integration is very high:
2 MCU + wifi+BLE on chip, and you can easily find boards with OLED, Lora, beside the serial0 used by bootloader, there are still serial1 and 2 for other connections.
The integrated touch sensor could be used for water prove buttons.
So, I decided to put this program on ESP32 for easier development.
The first trouble I came across is the uart pin selection.
ESP32 has a pin muxing matrix function, so you can almost use any pin you want for your selected function. But there are some pins we should avoid:
Internal connection to flash.
pin related to bootloader.
So, I end up with connecting my GPS on serial1 pin4 as Rx, few modification on serial stuff, code works great...I love arduino!!
https://github.com/Ldsrc2008/AIS-encode-arduino/tree/master/GPS_ESP32_Uart104_make_AIS_sentence
Now I wish to add OLED display for :
- GPS status: 3D fix (or locationavailable?), sat Nr, Hdop
- GPS Lat, Lon
- GPS COG, SOG
- and maybe later heading, heeling angle
Again, I need to check the pins
There are several lib for 1306 OLED I have installed the following 2, they are all included in arduino IDE that I used V1.8.5:
- Driver for the SSD1306 and SH1106 based 128x64 pixel OLED display running on the Arduino/ESP8266 platform https://blog.squix.org/
- the Adafruit SSD1306 library repository on GitHub
With squix's blog has also some thing interest me a lot...
But...this wemos esp32 OLED board I2C pins are on GPIO 5 and 4 for data and clock respectively.So, I need to move my GPS pin...
So, In short GPIO0,1,2,3 are not usable, GPIO12 either(unless you will unplug the thing that you connected during boot up or loading code)
it should be straight forward with the library. then next concern is to see how to make the the page control and size of font and OLED.I got problem if I wish to add touch sensor....after looking in to all the stuff I have, I need to move again:
Rx1=IO13
TX1=IO16
Rx2=IO25
TX2=IO26
then I could leave me
touch6=IO14
touch3=IO15
The code could work without issue on boot nor download
留言
張貼留言