I am currently using Particle Argon Device with the attached GPS NEO 6M-0 001 device. I am trying to view the GPS data using my COM port on my PC to verify this is working.
(later i hope to send this data to google cloud).
I found this website which describes the steps involved and followed these.
It is the last part it states output window on the COM10 port. On my computer i have this set to COM3. However, my window is blank and not showing any data.
How did you interact with your PC com port ?
I'm assuming that Serial1 is used to exchange the data with GPS module. Serial is available on Particle devices USB port and if you will install Particle CLI can be read by simple command: particle serial monitor also can be read via this simple python script:
import serial
# this port address is for the my USB SERIAL on Photon
#
SERIAL_PORT = '/dev/ttyACM0'
# be sure to set this to the same rate used on your Argon
SERIAL_RATE = 9600
def main():
ser = serial.Serial(SERIAL_PORT, SERIAL_RATE)
while True:
# using ser.readline() assumes each line contains a single reading
# sent using Serial.println()
reading = ser.readline().decode('utf-8')
# reading is a string...do whatever you want from here
print(reading)
if __name__ == "__main__":
main()
Unfortunately Argon has just 1 Uart avialiable additional Uart's eg: Serial2 is avialiable on Photon but to connect the Uart to PC RS232 you wlil need someting like this Uart to RS232 converter
Hi thank you for your reply, for my setup i also have an accelerometer setup and to see the values on the serial port i made using a putty connection to COM3 serial. I was successfully able to see values output from the accelerometer using this. I first needed to send a command first before i seen values appear.
I expected as a test i would just need to do the same for the GPS module but the same COM3 (different filmware) did not show anything.
I just wanted to verify both work then i need to think on how i can combine these, i think i am going to run into issues is both are using the same COM3 ports but this would later be replaced in the code to publish the values to google cloud.
For info my accelerometer code as follows which ‘does’ show in putty com3 serial, what i don’t understand is why this doesn’t work the same for the GPS. Its most likely my misunderstanding
// This #include statement was automatically added by the Particle IDE.
#include "MPU6050.h"
int ledPin = D7;
// MPU variables:
MPU6050 accelgyro;
int16_t ax, ay, az;
int16_t gx, gy, gz;
bool ledState = false;
void toggleLed() {
ledState = !ledState;
digitalWrite(ledPin, ledState);
}
void setup() {
pinMode(ledPin, OUTPUT);
Wire.begin();
Serial.begin(9600);
// The following line will wait until you connect to the Spark.io using serial and hit enter. This gives
// you enough time to start capturing the data when you are ready instead of just spewing data to the UART.
//
// So, open a serial connection using something like:
// screen /dev/tty.usbmodem1411 9600
while(!Serial.available()) SPARK_WLAN_Loop();
Serial.println("Initializing I2C devices...");
accelgyro.initialize();
// Cerify the connection:
Serial.println("Testing device connections...");
Serial.println(accelgyro.testConnection() ? "MPU6050 connection successful" : "MPU6050 connection failed");
}
void loop() {
// read raw accel/gyro measurements from device
accelgyro.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
Serial.print("a/g:\t");
Serial.print(ax); Serial.print("\t");
Serial.print(ay); Serial.print("\t");
Serial.print(az); Serial.print("\t");
Serial.print(gx); Serial.print("\t");
Serial.print(gy); Serial.print("\t");
Serial.println(gz);
toggleLed();
I also tried particle serial monitor from CLI and it says Serial monitor opened successfully. The GPS device is flashing ‘red’. I’m thinking down the line of wrong wiring as it seems to indicate no signal.
Some users saying you should put a resistor in in the Rx connector or even disconnect. I’ve tried disconnecting. Also reports it can take hours to receive a GPS signal…
This isn’t easy! I’m on road to failure as this is only a small stepping stone in my project
I’m not really sure what is going on with this should work if is working with your accelerometer.
One thing which really doesn’t work for me here is that onSerialData() is called from Timer which is completely against documentation recommendation :
You should not use functions like Particle.publish from a timer callback.
Do not use Serial.print and its variations from a timer callback as writing to Serial is not thread safe. Use Log.info instead.
It is best to avoid using long delay() in a timer callback as it will delay other timers from running.
Avoid using functions that interact with the cellular modem like Cellular.RSSI() and Cellular.command().
entire _gps.onSerialData() prints to serial
Also regarding to your picture wchich show the connection with your Gps module looks for me that you have to swap the wires between Argon and GPS module should be:
Argon TX -> GPS RX
Argon Rx -> GPS TX
UPDATE
please note that Argon UART is not 5V tolerant ! looks like you pwered the GPS module from 5V
Thanks dreamER, basically for the GPS module i simply followed this guide which pointed me to particle library. I wasn’t sure where else to start? I have only had LEDs lighting up priory to this, i am very new to this!
Basically i type in GPS library ‘Particle-GPS’ and i choose parse-data.ino** and click on it for use this example (just a test). That is where i am, its produced code for testing. Surely i should be see something?
I’m thinking now its the GPS flashing red that there is;
Problem with my wiring? Do i need a resistor?
Faulty GPS
Maybe i could put in some de-code statements? Any ideas?
Much appreciated and thank you for your replies so far