1

Hi i'm tryng to change the update rate of my gps tracker(neo 6m ublok) i know the byte that i need to send are 0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A

i've tried echo -e "\xB5\x62\x06\x08\x06\x00\xC8\x00\x01\x00\x01\x00\xDE\x6A" > /dev/ttyAMA0

and with the service stopped i also tryed with a program in c

        #include <stdio.h>
        #include <fcntl.h>   /* File Control Definitions           */
        #include <termios.h> /* POSIX Terminal Control Definitions */
        #include <unistd.h>  /* UNIX Standard Definitions          */ 
        #include <errno.h>   /* ERROR Number Definitions           */
    void main(void)
    {
            int fd;/*File Descriptor*/

            printf(&quot;\n +----------------------------------+&quot;);
            printf(&quot;\n |        Serial Port Write         |&quot;);
            printf(&quot;\n +----------------------------------+&quot;);

            /*------------------------------- Opening the Serial Port -------------------------------*/

            /* Change /dev/ttyUSB0 to the one corresponding to your system */

            fd = open(&quot;/dev/ttyAMA0&quot;,O_RDWR | O_NOCTTY | O_NDELAY); /* ttyUSB0 is the FT232 based USB2SERIAL Converter   */
                                                                    /* O_RDWR Read/Write access to serial port           */
                                                                    /* O_NOCTTY - No terminal will control the process   */
                                                                    /* O_NDELAY -Non Blocking Mode,Does not care about-  */
                                                                    /* -the status of DCD line,Open() returns immediatly */                                        

            if(fd == -1)                                            /* Error Checking */
               printf(&quot;\n  Error! in Opening ttyUSB0  &quot;);
            else
               printf(&quot;\n  ttyUSB0 Opened Successfully &quot;);


            /*---------- Setting the Attributes of the serial port using termios structure --------- */

            struct termios SerialPortSettings;      /* Create the structure                          */

            tcgetattr(fd, &amp;SerialPortSettings);     /* Get the current attributes of the Serial port */

            cfsetispeed(&amp;SerialPortSettings,B9600); /* Set Read  Speed as 9600                       */
            cfsetospeed(&amp;SerialPortSettings,B9600); /* Set Write Speed as 9600                       */

            SerialPortSettings.c_cflag &amp;= ~PARENB;   /* Disables the Parity Enable bit(PARENB),So No Parity   */
            SerialPortSettings.c_cflag &amp;= ~CSTOPB;   /* CSTOPB = 2 Stop bits,here it is cleared so 1 Stop bit */
            SerialPortSettings.c_cflag &amp;= ~CSIZE;    /* Clears the mask for setting the data size             */
            SerialPortSettings.c_cflag |=  CS8;      /* Set the data bits = 8                                 */

            SerialPortSettings.c_cflag &amp;= ~CRTSCTS;       /* No Hardware flow Control                         */
            SerialPortSettings.c_cflag |= CREAD | CLOCAL; /* Enable receiver,Ignore Modem Control lines       */ 


            SerialPortSettings.c_iflag &amp;= ~(IXON | IXOFF | IXANY);          /* Disable XON/XOFF flow control both i/p and o/p */
            SerialPortSettings.c_iflag &amp;= ~(ICANON | ECHO | ECHOE | ISIG);  /* Non Cannonical mode                            */

            SerialPortSettings.c_oflag &amp;= ~OPOST;/*No Output Processing*/

            if((tcsetattr(fd,TCSANOW,&amp;SerialPortSettings)) != 0) /* Set the attributes to the termios structure*/
                printf(&quot;\n  ERROR ! in Setting attributes&quot;);
            else
                printf(&quot;\n  BaudRate = 9600 \n  StopBits = 1 \n  Parity   = none&quot;);

            /*------------------------------- Write data to serial port -----------------------------*/

            char write_buffer[] = &quot;A&quot;;      /* Buffer containing characters to write into port           */
            unsigned char packet[] = { 0xB5,  0x62, 

    0x06, // 

    0x08, // 

    0x06, // length

    0x00, // 

    0x64, // measRate, hex 64 = dec 100 ms

    0x00, // 

    0x01, // navRate, always =1

    0x00, // 

    0x01, // timeRef, stick to GPS time (=1)

    0x00, // 

    0x7A, // CK_A

    0x12, // CK_B

};
            int  bytes_written  = 0;        /* Value for storing the number of bytes written to the port */ 
            //for(int i=0;i&lt;14;i=i+1){
            //      printf(packet[i]);

//} bytes_written = write(fd,packet,sizeof(packet));/* use write() to send data to port / / "fd" - file descriptor pointing to the opened serial port / / "write_buffer" - address of the buffer containing data / / "sizeof(write_buffer)" - No of bytes to write */ char buf [100]; int n = read (fd, buf, sizeof buf); printf(buf); printf("\n %s written to ttyUSB0",write_buffer); printf("\n %d Bytes written to ttyUSB0", bytes_written); printf("\n +----------------------------------+\n\n");

            close(fd);/* Close the Serial port */

    }

and with python

import serial
#from serial import Serial

import time

import string

import pynmea2

port="/dev/ttyAMA0" ser=serial.Serial(port, baudrate=9600 , parity=serial.PARITY_NONE,

stopbits=serial.STOPBITS_ONE,

bytesize=serial.EIGHTBITS,)

#serdata= bytearray([0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A,0xB5,0x62,0x06,0x01,0x08,0x00,0xF0,0x01,0x00,0x00,0x00,0x00,0x00,0x01,0x01,0x2B]) #0x06"0x00"0xC8"0x00"0x01"0x00"0x01"0x00"0xDE"0x6A"

#serdata= bytearray([0xB5,0x62,0x06,0x08,0x06,0x00,0xC8,0x00,0x01,0x00,0x01,0x00,0xDE,0x6A]) #print(serdata) ser.write(b"$PUBX,40,GLL,0,0,0,05D\r\n") #ser.write(bytes([181,98,6,8,6,0,100,0,1,0,1,0,122,18])) # 5hz #ser.write(b'$PUBX,40,GLL,1,0,0,0,0,05D') #ser.write(serdata) #ser.flush() #ser.write(bytearray([181, 98, 6, 1, 8, 0, 240, 1, 0, 0, 0, 0, 0, 1, 1, 43])) #GxGLL off #serdatadi=bytearray([0xB5,0x62,0x06,0x01,0x08,0x00,0xF0,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x39]) #serdatadi2=bytearray([0xB5,0x62,0x06,0x01,0x08,0x00,0xF0,0x04,0x00,0x00,0x00,0x00,0x00,0x01,0x04,0x40]) #print(serdatadi2) #ser.write(b"0xB5,0x62,0x06,0x01,0x08,0x00,0xF0,0x03,0x00,0x00,0x00,0x00,0x00,0x01,0x03,0x39") #ser.write(serdatadi2) #ser.write(serdatadi3) #ser.write(b"0xB5,0x62,0x06,0x01,0x08,0x00,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00,0x24") #ser.write(b'\xb5b\x06\x08\x06\x00\x1e\x00\x01\x00\x00\x003l') while True:

    #port=&quot;/dev/ttyAMA0&quot;

    #ser=serial.Serial(port, baudrate=9600, timeout=0.5)

    dataout = pynmea2.NMEAStreamReader()
    newdata=ser.readline()
    print(newdata)

    #print(newdata[0:6] == &quot;$GPRMC&quot;)
    if (newdata[0:6] == b&quot;$GPRMC&quot;):
            print(&quot;vivo&quot;)
            newmsg=pynmea2.parse(newdata.decode(&quot;utf-8&quot;))
            print(newmsg)
            lat=newmsg.latitude

            lng=newmsg.longitude

            gps = &quot;Latitude=&quot; + str(lat) + &quot;and Longitude=&quot; + str(lng)

            print(gps)

but nothig change the navigation update rate of the device

all of the byte code came from the manual of the device
https://www.u-blox.com/sites/default/files/products/documents/u-blox6_ReceiverDescrProtSpec_%28GPS.G6-SW-10018%29_Public.pdf

and this

https://medium.com/@cglabs/neo-6m-gps-howto-boost-data-receiving-speed-neo-6-neo-7-neo-8-487275eff1c6

and this

https://forum.arduino.cc/index.php?topic=470763.0 wiring gps wire

EDIT: i've tryed both of the response but none of them worked cutecom what i have to do if i want to connect with usb instread of uart

EDIT2: i have tryed both usb to the raspberry and the pc with the u center but none of this changed the rate of the gps!! edit 3: no luck i've tryed eaven an update of the firmware but nothing it's like it dose not like changing configuration

Setup pipes

Firmware update tool launched

-p STDIO -b 9600:9600:9600 -F "C:\Program Files (x86)\u-blox\u-center_v20.01\flash.xml" -s 1 -t 1 -v 1 "D:\dowload\EXT_G60_LEA-6H.fd1146bafac24b1347701312d42bb698.bin"

----------CMD line arguments-----------

Image file: D:\dowload\EXT_G60_LEA-6H.fd1146bafac24b1347701312d42bb698.bin Flash: <compiled-in> Fis: C:\Program Files (x86)\u-blox\u-center_v20.01\flash.xml Port: STDIO Baudrates: 9600/9600/9600 Safeboot: 1 Reset: 1 AutoBaud: 0 Verbose: 1 Erase all: 1 Erase only: 0 Training sequence: 1 Chip erase: 0 Merging FIS: 0 Update RAM: 0 Use USB alt: 0


0.0 u-blox Firmware Update Tool version 19.03

0.0 Updating Firmware 'D:\dowload\EXT_G60_LEA-6H.fd1146bafac24b1347701312d42bb698.bin' of receiver over 'STDIO' 0.0 - Opening and buffering image file

0.0 - Verifying image

0.0 Image (file size 395996) for u-blox6 accepted

0.0 Image Ver '7.03 (45970) Mar 17 2011 16:26:24' 0.0 - CRC= 0x10F85FE1 0xF912EA5A 0.0 - Trying to open port STDIO

0.0 - Setting baudrate to 9600

0.2 - Sending training sequence

1.2 - Retry poll

2.2 - Retry poll

3.2 - Retry poll

3.2 ERROR: Version poll failed.

3.2 Firmware Update FAILED

Firmware Update Utility has unexpectedly terminated

Exit code (2)

these are the connector and the multimeter sat between the first and the last 3.2-3.3 the soldering

tlfong01
  • 4,665
  • 3
  • 10
  • 24
awaska
  • 23
  • 1
  • 8
  • Hi @awaska, Welcome and nice to meet you. Ah, let me see. (1) Can I assume that you have setup your Neo6 and that cgps and xgps run OK? If yes, then your serial setup should be default 9600, 8N1, (2) Can I assume that you know you are using ttySerial0 or ttyUSB by setting the gps config file? (2) Suppose you are using ttyUSB0, and using python to send the bytes to change nav rate for 1Hz to 5Hz. (3) One troubleshooting trcik you might use is to do the serial loopback test, with (a) Neo6 removed from serial port. (b) short TxD to RxD and see if Rx loopback Tx. / to continue, ... – tlfong01 Jun 18 '20 at 13:24
  • Actually you can use any terminal emulator, say Win10 RealTerm, Rpi CuteCom, or miniCom etc to send the update to 5Hz bytes to Neo6. Please let me know if you wish to know more about python serial loopback program, or terminal emulator to do loop back test and send bytes to Neo6. Cheers. – tlfong01 Jun 18 '20 at 13:27
  • 1
    hi thanks for the responi connected my gps trough uart, i can read the message of the gps with no problem using cat or the python program, i've tryed the serial loopback and it works i've shorted the 2 pin and if i do echo "test" > /dev/serial0 and cat -v < /dev/serial0 i can see test so the serial is working, i've tryed trougth the u-center with network serial for controlling the gps but still the gps won't change i've retryed with bash ans the hex directly given from the u-center but still the update rate won't change, is wrong how i wrote the code in python for writing the hex? – awaska Jun 18 '20 at 15:18
  • 1
    What you send to/dev/ttyAMA0 with echo is not a byte. – Ingo Jun 18 '20 at 17:40
  • 1
    when i tryed to send byte the serial gose crazy and start to repeat the message and after some time i can't write anything and when i read the serial is just brakeline, i have the jumper, and after reboot when i send echo -e -n "\xB5\x62\x06\x01\x08\x00\xF0\x01\x01\x00\x00\x01\x01\x00\x03\x35" > /dev/serial0 echo -e -n "\xB5\x62" > /dev/serial0 i read nothing from the serial cat -v < /dev/serial0 but if i send echo "test" > /dev/serial0 strange stuff append, the word test is repited multiple time with incrising space – awaska Jun 18 '20 at 19:48
  • 1
    this is the resul of ```cat -v < /dev/serial0 test

    test

    test

    test

    test

    test

    test```

    – awaska Jun 18 '20 at 19:52
  • Just to confirm. Did you mean that you also used u-center config but still no luck? Please see my u-center log below. And for the UBX message, can you try (1) End the frequency update string with *check sum, and (2) End the UBX message with CR, LF*? – tlfong01 Jun 20 '20 at 05:15
  • @awaska, Part A of my answer shows how to use the u-center to set my Neo-8M measurement rate to 0.25Hz, and the measurements now repeat every four seconds. You might like to verify with your Neo-6M. Good luck. Cheers. – tlfong01 Jun 20 '20 at 13:09
  • Part B shows how to use CuteCom to send 14 byte UBX command to change the update rate to 4 seconds. – tlfong01 Jun 22 '20 at 15:10

2 Answers2

1

Question

How can Rpi change Neo-6M / 8M GPS measurement/navigation update rates?


Answer

Update 2020jul01hkt1345

The OP uses a python program to change the update rate but has no luck. His python program imports pynmea2 to handle the RMC sentence.

Now I am trying to repeat the python program and see if the program works. I am using Knio's pynmea2 (Ref 37)


Short Answer

Contents

Part A - Using ublox u-centre

Part B - Using Rpi CuteCom

Part C - Using Thonny python


Part A - Using u-center to do the frequency setting

u-center screen below shows if measurement frequency is set to 0.25Hz, then the test measurements repeats every 4 seconds.

set rates


Part B - Using cuteCom to send UBX message to change update rate to 4 seconds

(1) Try end measurement/navigation frequency command with the two check sum bytes. See Appendix E for an example to calculate the check sum for a update rate to 4000mS command.

(2) Try end UBX message with CR, LF. (update - CR, LF is not necessary for hex input, only necessary for text input)

Note - it is much more newbie friendly to use GUI Rpi terminal emulator cuteCom than CLI bash echo and cat.

I have compiled a command message to set the measurement rate to 4 seconds. Then I used cuteCom to input the 14 byte command string to Neo-8M serial. Neo-8M accepted the command and measurement rate became 4 seconds.

set update rate


Part C - Using Rpi4B Thonny Python to set Neo-8M/7M update rate

References

(1) pySerial Short Introduction

(2) pySerial API

Now I am thinking of using thonny python 3.7.3 to set the Neo-8M/7M measurement update rates. To make things simple, I will only handle the RMC and ZDA sentences, as shown below:

update 4000mS


neo-7m test


References

(1) NEO-M6 Receiver Description Including Protocol Specification - ublox

(2) NEO-M6 GPS NMEA message parsing in python (with checksum calculation) - tomazas/nmea_ublox.py 2015

(3) NEO-M6 How to update system Date & Time from GPS in python (with checksum calculation) - 2016dec15

(4) NEO-M8 Receiver description Including protocol specification R19 - 2020may14

(5) NEO-M8 concurrent GNSS modules Product sheet R07 - 2020apr30

(6) NEO-M8 GNSS modules Hardware integration manual R07 - 2020may20

(7) Fletcher's Checksum - Wikipedia

(8) Fletcher's Checksum - TutorialsPoint

(9) Endianness (Big and Little Endian) -Wikipedia

(10) Enabling/disabling NMEA sentences on u-Blox gps receiver? - GIS SE Q&A Asked 2016jun17 Viewed 13k times

(11) Getting Started with U-Center for u-blox - SparkFun

(12) SparkFun GPS-RTK Board - NEO-M8P-2 - US$200

(13) GPS-RTK Hookup Guide - SparkFun

(14) What is GPS RTK? - SparkFun

(15) Enable or disable NMEA datasets in u-blox GPS module - HandHeldGroup 2018apr18

(16) Enabling/disabling NMEA sentences on u-Blox gps receiver? - Asked 4 years ago, Viewed 13k times

(17) GIS StackExchange

(18) NMEA 0183 - Wikipedia

(19) NMEA (National Marines Electronics Association) Official Web Site

(20) NMEA 0183 V4.10 Standard - NMEA

(21) NMEA v3.01 data - gpsInfo.org

(22) Global Positioning System, Principle and Practices - Satheesh Gopi, McGraw-Hill 2005

(23) BeiDou - Wikipedia

(24) NEO-M9N module product summary - u-blox

(25) Multiple UART/serial loopback program v0.00 tlfong01 2019jun03

(26) NEO-6M NEO-7M Double sided GPS Mini Module NEO-M8N Satellite positioning microcontroller SCM MCU development board for Arduino US$6

(27) AliExpress USB to TTL adapter USB to serial converter with real FTDI USB UART IC FT232RL - US$2.4

(28) AliExpress TZT FT232 FT232BL FT232RL USB 2.0 to TTL level download cable to serial card adapter Module 5V 3.3V - US$1.6

(29) UbloxRAW - UBX messages providing raw measurements - OpenStreetMap

(30) AllStar GNSS Receiver Protocol Specification V2.3 - AllStar, China Electronics

(31) NEO-6M GPS Module (5V Vcc, with schematic) - SunFounder

(32) NEO-6M u-blox 6 GPS Modules Data Sheet

(33) NEO-7M u-blox 7 Receiver Description Including Protocol Specification V14 - 2018jun15

(34) NEO-7M u-blox 7 GNSS modules Data Sheet R07 - ublox 2014nov11

(35) NEO-7M series Product Info (7M has no programmable flash, No BeiDou)

(36) NEO-7M UART GPS NEO-7M-C User Manual - WaveShare

(37) Knio/pynmea2 a python library for the NMEA 0183 protocol (Python 2.7, 3.4+ compatible) - Knio, GitHub 2020mar22

(38) NMEA0183 pynmea2/NMEA0183.pdf

(39) AT100 GPS-GPRS Vehicle Tracking Device - Astra Telematics

(40) AT100 GPS-GPRS Telematics Module NMEA Command Reference R3.0 - Astra Telematics 2009Oct


Appendices

Appendix A - Set rates

set rates


Appendix B - UBX Checksum

ubx checksum


Appendix C - NEO-8M Set Measurement and Navigation Update Rates

neo8m set rate


Appendix D - UBX Checksum Program

checksum 1

Appendix E - Python program to calculate checksum

# fletcher_chksum02.py Fletcher 8-bit checksum - tlfong01  2020jun22hkt2147

*** NEO-6M/8M IBX Message Examples ***

--------------------------------------------------------------------------------------------------------------------

synC1 synC2 class id length measRate navRate timeRef checkSum measurement update rate

--------------------------------------------------------------------------------------------------------------------

0xb5, 0x62, 0x06, 0x08, 0x06, 0x00, 0x64, 0x00, 0x01, 0x00, 0x01, 0x00, 0x7A, 0x12 measRate 0x64 = 100ms = 0.1 sec

0xB5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xC8, 0x00, 0x01, 0x00, 0x01, 0x00, 0xDE, 0x6A measRate 0xc8 = 212ms = 0.2 sec

0xB5, 0x62, 0x06, 0x08, 0x06, 0x00, 0xa0, 0x0f, 0x01, 0x00, 0x01, 0x00, 0xC5, 0xC5 measRate 0xfa0 = 4000ms = 4.0 sec

--------------------------------------------------------------------------------------------------------------------

dataByteList01 = [0x06, 0x08, 0x06, 0x00, 0x64, 0x00, 0x01, 0x00, 0x01, 0x00] dataByteList02 = [0x06, 0x08, 0x06, 0x00, 0xC8, 0x00, 0x01, 0x00, 0x01, 0x00] dataByteList03 = [0x06, 0x08, 0x06, 0x00, 0xa0, 0x0f, 0x01, 0x00, 0x01, 0x00] # measRate = 0xa0 0x0f = 0xfa0 = d4000

def calcCheckSum(dataByteList): ckA = 0 ckB = 0 for dataByte in dataByteList: ckA = ckA + dataByte ckB = ckB + ckA ckA = ckA & 0xff ckB = ckB & 0xff print(hex(ckA), hex(ckB)) return

calcCheckSum(dataByteList01) calcCheckSum(dataByteList02) calcCheckSum(dataByteList03)

*** End of program ***


Appendix F - NMEA v3.01 data - gpsInfo.org

NMEA v3.01 data - gpsInfo.org


nmea sen 1a1


nmea sen 2b1


Appendix G - RMC, DZA Sentences Screen Capture

u-centre rmc zda msg


Appendix H - Dual Neo-8M Setup

dual neo 8m setup


Appendix I - Python Calculate Checksums for UBX Commands to Set Update Rates to 1, 2, and 4 Seconds

# Program:
#   neo8m_test08.py  tlfong01  2020jun29hk1617

*** Neo8M GPS Module Test Functions ***

[0x06, 0x08, 0x06, 0x00, 0xe8, 0x03, 0x01, 0x00, 0x01, 0x00]],

['Two Seconds Update Rate', [0x06, 0x08, 0x06, 0x00, 0xd0, 0x07, 0x01, 0x00, 0x01, 0x00]],

['Four Seconds Update Rate', [0x06, 0x08, 0x06, 0x00, 0xa0, 0x0f, 0x01, 0x00, 0x01, 0x00]

ubxNameCommandList = [ ['One Second Update Rate', [0x06, 0x08, 0x06, 0x00, 0xe8, 0x03, 0x01, 0x00, 0x01, 0x00]], ['Two Seconds Update Rate', [0x06, 0x08, 0x06, 0x00, 0xd0, 0x07, 0x01, 0x00, 0x01, 0x00]], ['Four Seconds Update Rate', [0x06, 0x08, 0x06, 0x00, 0xa0, 0x0f, 0x01, 0x00, 0x01, 0x00]] ]

def calcFletcher8BitCheckSum(dataByteListName, dataByteList): ckA = 0 ckB = 0 for dataByte in dataByteList: ckA = ckA + dataByte ckB = ckB + ckA ckA = ckA & 0xff ckB = ckB & 0xff print(' ', dataByteListName, ' ', convertOneByteNumToFourCharStr(ckA), convertOneByteNumToFourCharStr(ckB)) return

def convertOneByteNumToFourCharStr(oneByteNum): tempStr = ((hex(oneByteNum))[2:]) if (len(tempStr) != 2): tempStr = '0' + tempStr fourCharStr = '0x' + tempStr return fourCharStr

def testCalcChecksum(): testTitle = 'Calculate UBX Command Checksum' print('\nBegin Test', testTitle) print(' -------------------------------------') print(' Command Name Check sum') print(' -------------------------------------') for ubxNameCommand in ubxNameCommandList: ubxCommandName = ubxNameCommand[0] ubxCommand = ubxNameCommand[1] calcFletcher8BitCheckSum(ubxCommandName, ubxCommand) print(' -------------------------------------') print('End Test.')

*** Sample output tlfong01 2020jun29hkt1623 ***

''' Python 3.7.3 (/usr/bin/python3) >>> %Run neo8m_test08.py

Begin Test Calculate UBX Command Checksum

Command Name Check sum

One Second Update Rate 0x01 0x39 Two Seconds Update Rate 0xed 0xbd Four Seconds Update Rate 0xc5 0xc5


End Test. >>> '''


Appendix J - CuteCom Screen Shots Showing Neo8M Config Command Acknowledgement Messages

ack msgs


Appendix K - Neo-7M Changing Update Rate to 4 seconds, Enable RMC and ZDA Only

neo-7m change update rate test

tlfong01
  • 4,665
  • 3
  • 10
  • 24
  • 1
    look at the edit, by the way thanks so mutch for responding so quickly – awaska Jun 23 '20 at 22:56
  • Let me see. My CuteCom is using ttyUSB0 and you ttyAMA0. If you want to use ttyUSB0, then say so to CuteCom. But if you want to talk USB to USB (or SPI or I2C) then you might like to consider SparkFun's USD200 recommendation (Ref 12). By the way, I tried S0, AMA0, Serial0, and USB0 and found all except AMA0 not always working. So I almost always use USB0 in my experiments. Please also see my comments to @tqhien about my bad experiences on AMA0. Another reason of using ttyUSB0 is that my plan is using ttyUSBn for more than 6 GNSSs at the same time. – tlfong01 Jun 24 '20 at 01:15
  • 1
    eaven with usb the update rate dose not change i have bougth https://www.amazon.it/dp/B013QRUA6W i can read without a problem but the rate dose not change – awaska Jun 25 '20 at 12:24
  • @awaska, your €7 USB to TTL cable seems unusual. Did you get it long long ago? I have never seen such a complicated adapter, with TxL and RxL, and "Sleep" terminal. I guess you should have capped the 5V/3V jumper to 3V. But there might be other settings that cause trouble. You might consider getting a simple, cheapy one like Refs 27, 28. – tlfong01 Jun 26 '20 at 08:24
  • @awaska, I am using an old version the adapter as in Ref 27. I just cap jumper to 3V and that is it. I don't even need to short CTS to RTS, to cheat on both sides. I guess CTS and RTS are set to yes, by default. – tlfong01 Jun 26 '20 at 08:48
  • 1
    no i bougth yesterday !! it was the cheapest and the fastest to arrive on amazon .... well now i have to wait 2-3 months for the board we will see. – awaska Jun 26 '20 at 12:01
  • 1
    is this good ? https://www.ebay.it/itm/113733167929 or is this better https://www.ebay.it/itm/333612681760 because i can't wait 3 month for aliexpress or pay 60 $ – awaska Jun 26 '20 at 13:36
  • Ah, wait a minute. To double check, I googled and found it OK to use for Rpi. I could not find any schematic but I guess TxL and RxL are just TxD and RxD related, but perhaps routed to LEDs. It is useful for those who wanted to use more UART signals, or RTS, CTS to notify Arduino and ESP8266 to reset or send a new sketch, instead of manually pushing a button. For new versions of ESP8266/32, such manual push button is replaced by software commands, so CTS and RTS are no longer needed. In short, don't waste money getting a new one. BTW. what did you use before that, perhaps this is also good. – tlfong01 Jun 26 '20 at 14:00
  • I now think that if either your old and new USB/TTL adapter not working for u-center/cuteCom to change update rate, then there is not likely the adapter's fault. I now think that there is 10% chance that your neo-6m is bad, so perhaps you might consider getting another neo-7m or 8m to do swap testing. Or if you can wait a couple of days, I can search my junk box for a 6m and repeat your experiment, to hopefully find some thing important that we are missing. / to continue, ... – tlfong01 Jun 26 '20 at 14:12
  • Another thing you might like to try is using Rpi2/3/4 instead of RpiZ/W. I did once find RpiZ/W stretch does not work with some USB/TTL adapters which work with Rpi3B+. – tlfong01 Jun 26 '20 at 14:12
  • 1
    ok so what can i do now ? i have tryed varius times with ucenter and cutecom but still nothing so i have to give up to change the rate for the gps module.. thanks for all the time you spend on this. thanks now i'm trying with the raspverry pi the one from 2012 – awaska Jun 26 '20 at 14:12
  • Ah, I would suggest you to sit and do nothing, but just wait for me to complete a python neo-6/8m troubleshooting program in a couple of days. – tlfong01 Jun 26 '20 at 14:15
  • And in case you don't wish to waste time sit and do nothing, let me give you one assignment: (1) Read Refs 15, 16, to learn how to enable/disable a NMEA dataset, (2) Read Appendix F to understand the NMEA datasets RMC, and ZDA, then (3) Try to use u-centre to enable RMC and ZDA, and disable all others. My neo troubleshooting program will suppose your neo only updates RMC and ZDA, so you better get prepared. Ah. bed time, so see over or after the weekend. Cheers. – tlfong01 Jun 26 '20 at 14:41
  • 1
    i'think is the gps module because i can't change any configuration , i follow the exact same procedure but it dose not add message and it dose not remove them .searching online i fonund thath you can send a file of configuration and when i do that ... timeout occurred without receiving an answer. Retrying...! Sending: CFG-MSG - B5 62 06 01 08 00 F0 02 01 01 01 01 01 01 07 46 ... Sending: CFG-MSG - B5 62 06 01 08 00 F0 02 01 01 01 01 01 01 07 46 ... ... failed due to timeout! so i will stuck with 1hz of update rate – awaska Jun 26 '20 at 21:27
  • (1) Well, give me the link to the tutorial that says "you can send a file of configuration, ...". (2) You seems to say that your Neo6M is not receiving your command message, but there are many possibilities, such as (a) your Neo is deaf, (b) your RxD wire is broken. (c) Serial speed both side don't match, but you told me that you tried the loop back OK, but perhaps your checksum is wrong, or text commend without CR/LF, ... In short, there are 101 causes of trouble, ... – tlfong01 Jun 27 '20 at 01:04
  • 1
    this is the guide is old i know but i wanted to try https://github.com/jlnaudin/x-drone/wiki/How-to-setup-the-GPS-Ublox-NEO-6M-(Crius)-CN-06-V2 , i have tryed the serial loopback and it works with the usb to serial so deaf neo 6M? – awaska Jun 27 '20 at 09:31
  • yes, one non stop big mouth, no ears. – tlfong01 Jun 27 '20 at 11:40
  • Or perhaps little Neo is starving, therefore too weak to stand up to listen outside. You might like to check out SounFounder instructions to see how much you need to feed a neo: http://wiki.sunfounder.cc/index.php?title=Ublox_NEO-6M_GPS_Module. Neo needs 5 big Macs a meal, but are you only giving it 3 little Macs? – tlfong01 Jun 28 '20 at 00:38
  • Another thing is that Rpi (especially RpiZ/W) might only like popular UART drivers such as PL20xx, CH34x etc. Yours with the not so popular FTDI driver might not be welcome by Rpi/RpiZ/W. So you might like to try your luck other cables. Me using CH340 work happily. Reference: "Rpi3 USB serial cables discussion"? https://raspberrypi.stackexchange.com/questions/96697/how-many-serial-ports-are-on-the-pi-3/96698#96698. Cheers. – tlfong01 Jun 28 '20 at 00:49
  • So you see. USB/TTL adapters using FTDI chips are not welcome by Rpi: https://raspberrypi.stackexchange.com/questions/113820/raspberry-pi-3-model-b-ftdi-usb-to-serial-converter-driver-problem. On the other hand PL2302 and CH340 are welcome. – tlfong01 Jun 28 '20 at 03:41
  • I just read that for GPS, AMA0 is only for Rpi1,2. and S0 for others. You see, it is so confusingly depressing! https://stackoverflow.com/questions/52248914/gps-module-blinking-but-not-receiving-any-data-with-rpi-3 – tlfong01 Jun 28 '20 at 04:10
  • But then I have another thought. There is 10% chance that the Neo 6M baby indeed has good ears, which, because of her owner's bad soldering skills, have not been properly connected to the outside world. Perhaps the owner can use a multi-meter to check it out. – tlfong01 Jun 28 '20 at 06:33
  • 1
    idk you have to judje i have added the photo of the back of the module, teal me if i suck at soldering (2 time), the strangest thing is that eaven with the pc the module don't change configuration!!!both on windows and linux – awaska Jun 28 '20 at 11:16
  • 1
    eaven with 5 v it dose not change anything – awaska Jun 28 '20 at 11:23
  • Yes, you should power Neo with 5V, but using 3V3 might still work, though not that smoothly. Now I am thinking that your original question is a bit misleading. Perhaps we would ask the following: "How can we make sure that the Neo baby is listening?" In other words, if your Neo is not listening, or cannot listen, then of course you cannot ask her to do anything at all. And if you agree with me, what would you suggest to do now? – tlfong01 Jun 28 '20 at 12:32
  • On second thought, there is no special test to check if neo6m is listening. Eg, I can do the following: (1) Disable all output NMEA messages except for example RMC and ZDA, (2) Change measurement/navigation update rates from default 1 second to 2 or 4 seconds, (3) Save current configuration. Now the output text messages become only RMC and ZDA, repeating every 2 or 4 seconds. If u-centre text window does show any changes, but still continuously outputting the many more messages every one second, then your neo-6m has not received your commands, for any reasons including: / to continue, ... – tlfong01 Jun 28 '20 at 15:02
  • (1) Neo-6M serial input hardware not working, though output OK. This input problem might be caused by bad hardware connection wiring, bad pin soldering, Neo-6M's output pin broken etc. (2) ... Bed time. Call it a day. See you Monday or later. – tlfong01 Jun 28 '20 at 15:06
  • it's the only option tomorrow i will try to resolder the pin, maybe it will work, or i will start searching for other module – awaska Jun 28 '20 at 20:01
  • Yes, (1) There is 10% chance that the Neo6M's Rx pin is broken or not properly soldered/connected, (2) There is 10% chance that the Neo6M module's RxD circuit is broken. So it is a good idea to get a replacement. BTW, before resoldering, you might like to use a multi-meter to check continuity between Neo6M module's RX pin all the way to the Neo6M chip on the PCB. Good luck and cheers. – tlfong01 Jun 29 '20 at 03:39
  • Now I have compiled UBX commands to update rates to *1, 2, and 4 seconds* (Appendix I). Then I use CuteCom to try these commands and found them OK. I also verified that Neo8M *return acknowledgement messages* (Appendix J). – tlfong01 Jun 29 '20 at 09:08
  • And you soldering job looks laughably ugly. There is 20% chance that you heated up the Neo6M module's Rx pin for too long (Note 1), and the heat flows through the PCB's copper trace which might curl up and breaks, or too much heat flows to the UART part of the Neo6M chip and fries it. This is the cause of a circuit partially broken. Note 1 - I usually use my US$60 Solomon SL30 digital soldering station set at temperature 350 degrees Celcius and apply heat to a particular pin for 10 seconds or less. Usually 400C over 10 seconds might fry the circuit. / to continue, ... – tlfong01 Jun 29 '20 at 13:56
  • Reference: (1) "Solomon SL30 Deluxe 48 Watt Digital Solder Station - US$86": https://www.circuitspecialists.com/solomon-48-Watt-soldering-station-sl30.html. cHEERS. – tlfong01 Jun 29 '20 at 13:56
  • 1
    i don't remeber but it was my 2 time soldering so probably i fried the pin, can you send me some other module gps max 15 euro – awaska Jun 29 '20 at 17:34
  • You might like to do some window shopping before making up your mind. (1) "AliExpress- gps neo 8m catalog": https://www.aliexpress.com/w/wholesale-gps-neo-8m.html. – tlfong01 Jun 30 '20 at 02:04
  • I am using something like this, perhaps a bit too advanced for newbies: https://www.amazon.com/DIYmall-NEO-M8N-Module-HMC5983-Antenna/dp/B012RNLG0K/ref=pd_lpo_236_t_0/142-2601225-0649168?_encoding=UTF8&pd_rd_i=B012RNLG0K&pd_rd_r=b95a0caa-53ba-4783-9950-ca6cd4864772&pd_rd_w=2mvYm&pd_rd_wg=6HkLF&pf_rd_p=7b36d496-f366-4631-94d3-61b87b52511b&pf_rd_r=Q8FYQ24XV6VA6QHCMBYV&psc=1&refRID=Q8FYQ24XV6VA6QHCMBYV. – tlfong01 Jun 30 '20 at 02:47
  • Amazon sells the above DIYMall GPSV5 at US$28. I got a similar (not sure if fake) thing for around US$18 from TaoBao: TaoBao GYGPSV5-M8N NEO-M8N GPS APM2.6 ¥125 (USD18, €16) https://item.taobao.com/item.htm?spm=a1z1r.7974869.0.0.269c3ad4uoNkmo&id=589024915071. – tlfong01 Jun 30 '20 at 02:58
  • The GYGPSV5 is compatible with FPVdrone APM2.6 Driver Module: https://www.amazon.com/Controller-Top-Pin-Connector-ArduPilot-Control/dp/B06ZZH5R3F. – tlfong01 Jun 30 '20 at 03:15
  • Of course it might not be a good idea to be too ambitious to jump start to Neo-8M. Perhaps you can start with 7M to do newbie experiments, and then switch to 8M when you hopefully have become a GPS ninja (if not likely giving up already). Neo-7M at a price of US$5 should be affordable to fry: AliExpress NEO-7M GPS Modules https://www.aliexpress.com/w/wholesale-gps-neo-7m.html. Cheers. – tlfong01 Jun 30 '20 at 05:01
  • 1
    ok i will not give up because i'm bulding a gps tracker with the raspberry pi zeri with a custiom app so i want to finish this project, are the same or the one on aliexpress look like fake i dont' know, probably i will try the neo 7m but before i will try to solder led with resistor just for gain skils, thanks for all and when the gps arrive i will tell you in the edit if every things works. – awaska Jun 30 '20 at 08:23
  • (1) Yes, practising soldering work with LED is a good idea. You may also like to google one or two tutorials on basic soldering skills. (2) Neo-6M or Neo-7M can do GPS tracking OK. One problem with 6M or 7M is that they only do GPS, not GNSS including BeiDou. I need to use 8M because I want to try BeiDou. – tlfong01 Jun 30 '20 at 14:36
  • 1
    the neo 7M is arrived and it's working i can change the update rate and remove message!!!! thanks for all – awaska Jul 01 '20 at 10:41
  • How nice to hear your good news! Looking back, it has been a very pleasant problem solving experience with you. Have a great project. Cheers. – tlfong01 Jul 01 '20 at 13:10
1

You can send a string to your Neo with the following sentence (I didn't check the validity of your bytes):

echo -en '\xB5\x62\x06\x08\x06\x00\xC8\x00\x01\x00\x01\x00\xDE\x6A' > /dev/ttyAMA0

But you need to be under the root user for both side of the ">" character : if you do only

sudo echo [...] > /dev/ttyAMA0

the echo command is executed as root, but opening device ttyAMA0 for writing is not.

So you'll have to make a "sudo su" before all that.

As for your program, it'll have to be executed as root to be able to open /dev/ttyAMA0 for writing.

tqhien
  • 111
  • 2
  • Many thanks for your advice and clarification. I found "/dev/ttyAMA0" and "/dev/Serial0" problematic. And ”sudo su" seems to solve the problem. On the other hand, "/dev/ttyS0" and "/dev/ttyUSB0" seems problem free. – tlfong01 Jun 23 '20 at 09:30
  • 1
    Raspberry Pi has 2 uart : PL011 (/dev/ttyAMA0) and miniUart (/dev/ttyS0). Then, depending of the Pi, primary and secondary order is not the same. For example, ZeroW, Pi3 and Pi4 define Primary (/dev/serial0) on the miniuart and the secondary (/dev/serial1) is used by bluetooth. On PiZero, Pi1 and Pi2, primary is on PL011 and secondary on miniuart ! issue a ls -l /dev to know what is the configuration. Note that in config.txt, device tree overlay may be used to change those settings. See link for details – tqhien Jun 25 '20 at 09:41
  • 1
    On your photos, you connected your (serial, not USB) GPS on the PL011 (ttyAMA0). You need to disable BT to get access to AMA0, with a dtoverlay=pi3-disable-bt in config.txt (boot partition) and remove any mention to ttyAMA0 in cmdline.txt (also on boot partition). – tqhien Jun 25 '20 at 09:59
  • 1
    i have already done it but still nothing eaven with direct connection between ucenter and the module! – awaska Jun 25 '20 at 12:39
  • 1
    U-Center is a Windows program. For Rpi, I do only console. Also, Neo-GPS is 9600 bauds, so you may need to add sudo stty -F /dev/ttyAMA0 speed 9600 to set that before any other thing. For example, gpsd is by default set to 4800 and without that instruction, communication can't be established. With all that, I can set and get GPS data from my PiZero and Pi3. – tqhien Jun 25 '20 at 17:04