11/23/2017 7:02 PM | |
Posts: 439 Rating: (108) |
Hello, I work in my spare times on a project with a GPS shield on the IOT 2040. Here is the shield I am using: I tried it on a Arduino UNO successfully with the following code:
Thanks to educ8s for the code! Arduino Tutorial: Arduino GPS tutorial with MakerStudio GPS shield and Arduino Uno. Easy DIY project I can see the longitude and latitude print in the USB serial port via the serial monitor of Arduino IDE. Here is my issue, "SoftwareSerial" is not a library support by IOT2040 since it is based on the Intel Galileo Gen. Here is the error in the compilation log:
So I have to modify code using the library "SoftwareSerial_GalileoGen2". I think I did pretty much all I need to replace in the code, but I get errors in the compilation log. Here is the modified code: (I put the "SoftwareSerial" call and functions in comments // to disable it an to keep in mind what was there before.)
Here is the errors I get at the end of the compilation:
I don't get those errors with the Arduino UNO. It seems to be related to the TinyGPSPlus library, probably not support as the SoftwareLibrary is. If anyone have an idea or tips, I would really appreciate. I will let you know if there is any development. Have a good day! Best regards, Hugo |
11/24/2017 4:49 AM | |
Posts: 439 Rating: (108) |
Hi, I made a HUGE step forward by going back 3 steps. I noticed the arduino sketch specify which pin is use as serial RX-TX. They use pin 2 and 3.
I looked in the IOT manual and figured out the X11 connector use pin 1 and 2 as RxD/TxD. So I changed the jumper to fit with 0 and 1, 0 as TX and 1 as RX. Then, I used Node-RED "Serial" node to read /dev/ttyS0. I am now able to see the NMEA GPS data in the debug window. I am so happy. I will try to convert the result into longitude/latitude value and show them in "node-red-contrib-web-worldmap". I will let you know any developments. Best regards, Hugo |
This contribution was helpful to1 thankful Users |
12/22/2017 8:27 PM | |
Posts: 439 Rating: (108) |
Hello, I manage to convert the result into longitude/latitude value and show them in "node-red-contrib-web-worldmap". I am now able to see my current position into the "node-red-contrib-web-worldmap" webpage. #1 You need to get the GPRMC data as shown in the previous post. #2 Use "Split" node to only get GPRMC data #3 Convert NMEA data from the serial port to decimal port and to the format need by "worldmap" node. I used the "function" javascript node to convert the data to decimal and send it in the format "node-red-contrib-web-worldmap" want it. Here is the code in the javascript function node:
#4 You have to install "node-red-contrib-web-worldmap" Via PuTTY, use the following command:
Once the reboot is done, you will see the "worldmap" and "tracks" nodes into "location" section. #5 Connect everything Here is the complete flow: Here is the export code:
You then have to go to the worldmap using URL like that:
Here is the final result on the worldmap: You can click on the red icon and display longitude latitude. You can also have multiple icon on the map. I hope it will help someone. Best regards, Hugo |
Follow us on