How to use ZED-F9P as a base station for Trimble - The Combine Forum
 16Likes
Reply
 
LinkBack Thread Tools
post #1 of 12 (permalink) Old 04-03-2019, 03:22 PM Thread Starter
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,368
Mentioned: 5 Post(s)
Quoted: 828 Post(s)
How to use ZED-F9P as a base station for Trimble

Just a quick little FYI for future reference in case anyone goes down the road I've just been on. I have successfully used the ZED-F9P as a GNSS RTK base station for my Trimble 372 receiver, and I imagine that what I've learned will work with any Trimble receiver that can receive RTCM data from an external RS232 source on Port C. For a GPS-only fix, Trimble seems to work with message types 1005 (or 1006), 1008, and 1077. For a GPS and Glonass fix, Trimble appears to work with 1005 (or 1006), 1008, 1077, 1087, and 1230.

The message type that Trimble requires that isn't available on the ZED-F9P is 1008, which is "Antenna Descriptor." Why Trimble needs this I don't know. I wrote a simple Python program that takes RTCM data as input, and outputs the data straight out, but after each 1005 or 1006 message, it outputs a dummy 1008 message (dummy as in blank, empty fields). With this added to the RTCM stream, The 372 acquires an RTK fix fairly quickly.

I intend to convert this python program to C and run it on an arduino, which will either stand between the ZED-F9P and the base station radio, or stand between the rover radio and the Trimble receiver. I am leaning towards the former so that nothing special is required on the Trimble receiver.

Here's the Python code, which takes data on standard in and outputs to standard out:
Code:
#!/usr/bin/python3

import sys

while True:
    data = sys.stdin.buffer.read(1)
    while (data != b'\xd3'):
        data = sys.stdin.buffer.read(1)

    length_data = sys.stdin.buffer.read(2)
    length = (length_data[0] << 8) + length_data[1]
    packet_data = sys.stdin.buffer.read(length)
    crc24_data = sys.stdin.buffer.read(3)

    message_number = (packet_data[0] << 8) + packet_data[1]
    message_number >>= 4

    sys.stdout.buffer.write(b'\xd3')
    sys.stdout.buffer.write(length_data)
    sys.stdout.buffer.write(packet_data)
    sys.stdout.buffer.write(crc24_data)
    sys.stdout.flush()

    if message_number == 1005:
        # blank 1008 message for Trimble
        sys.stdout.buffer.write(bytes([0xd3,0x00,0x06,0x3f,0x00,0x00,0x00,0x00,0x00,0x99,0x25,0xca]))

        sys.stdout.flush()
for testing puroses, I use socat to read from one serial port, pass the data through this little program, and write it to another serial port, connected to the machine:
Code:
socat /dev/ttyUSB1,b57600,raw - | ./trimbleadd1008.py | socat - /dev/ttyUSB2b,38400,raw
Maybe someone will find this useful. I'll post arduino code in the next few days.

BrianTee, gorgous, Kaupoi and 4 others like this.
torriem is offline  
Sponsored Links
Advertisement
 
post #2 of 12 (permalink) Old 04-04-2019, 12:28 AM Thread Starter
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,368
Mentioned: 5 Post(s)
Quoted: 828 Post(s)
I've decided to do the injection of message type 1008 on the base station. That way roving clients just work.

So the way I'm thinking of doing this is to have an arduino uno on the bottom, and then the SimpleRTK2 board on that, and then the radio module on an adapter board on top of that. That way the uart1 port of the Simple RTK2 plugs directly into the Arduino Uno's main serial interface, and the alternate serial TX pin will pass through on pin 9. The Uno pinout will provide 5V to the IOREF input of the SimpleRTK2. I will need to order some of of those stackable headers to solder to the SimpleRTK2.

Here's some code, which uses the AltSoftSerial library, but I think any of the software serial libraries will work for this simple application:
Code:
#include <AltSoftSerial.h>

/*
  Reads in a stream of RTCM3 data on the software serial
  port, outputs it to the built-in serial port.  If
  a message type of 1005 or 1006 is detected, a blank
  1008 message will be inserted into the output stream,
  which should allow a ZED-F9P RTK base station to work with
  Trimble roving receivers, which require 1008.

  Pin 8 is RX from the radio module (unused)
  Pin 9 is TX to the radio module

  Pin 0 is RX from the F9P
  Pin 1 is TX to the F9P (unused)

  For Uno or similar board. Other boards might require
  different pins for the AltSoftSerial port.  See the
  AltSoftSerial documentation for more information.
 */

// Blank RTCM3 type 1008 message
const char packet1008[12] = { 0xd3,0x00,0x06,0x3f,0x00,0x00,0x00,0x00,0x00,0x99,0x25,0xca };

AltSoftSerial mySerial(8,9); // RX, TX

void setup() {
    Serial.begin(57600);
    while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
    }

    // set the data rate for the SoftwareSerial port
    mySerial.begin(57600);
}

void loop() {
    byte c;
    int length;
    unsigned int type;

    int count;
    c = 0;

    //Look for start of RTCM3 message
    while (c != 0xd3) {
        if (Serial.available()) {
            c = Serial.read();
            mySerial.write(c); //pass it through to the radio
        }
    }
  
    //Okay we might have found one, lets get the length
    count = 0;
    length = 0;
    while (count < 2) {
        if (Serial.available()) {
            c = Serial.read();
            mySerial.write(c);
            length = (length << 8) + c;
            count ++;
        }
    }
    length = length & 0x07ff; //isolate only the least significant 10 bits
 
    //identify the message type
    count = 0;
    type = 0;
    while (count < 2) {
        if (Serial.available()) {
            c = Serial.read();
            mySerial.write(c);
            type = (type << 8) + c;
            count ++;
        }
    }
    type = type >> 4; //isolate type form the most significant 12 bits

    //Now pass through the rest of the message
    count = 0;
    while (count < length + 1) {
        //read in the message body, less the 2 type bytes, and then
        //the 3 CRC bytes, so length + 1.
        if (Serial.available()) {
            c = Serial.read();
            mySerial.write(c);
            count ++;
        }
    }

    if (type == 1005 || type == 1006) {
        //inject a 1008 message
        mySerial.write(packet1008, 12);
    }
}


torriem is offline  
post #3 of 12 (permalink) Old 04-04-2019, 08:46 AM
Senior Member
 
Join Date: Jan 2018
Location: P.E.I. Canada
Posts: 189
Mentioned: 1 Post(s)
Quoted: 80 Post(s)
Is this set up feeding corrections to your Reach units as well? Thanks for posting this.
WTalen is offline  
Sponsored Links
Advertisement
 
post #4 of 12 (permalink) Old 04-04-2019, 10:09 AM Thread Starter
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,368
Mentioned: 5 Post(s)
Quoted: 828 Post(s)
Despite my previous failed attempts, it appears that the Reach RS+ can use the F9P as a base station directly. At least it's working perfectly this morning for me. This 1008 injection is not required for the reach. I'll do some more experimenting and get back to you. I think previously I was using MSM4 messages, while now I've added MSM7 messages, which are redundant with the MSM4. I'll do a few tests and get back to you on this.
WTalen likes this.

Last edited by torriem; 04-04-2019 at 10:53 AM.
torriem is offline  
post #5 of 12 (permalink) Old 04-04-2019, 07:41 PM Thread Starter
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,368
Mentioned: 5 Post(s)
Quoted: 828 Post(s)
Yes the Reach RS worked great today with 1005, 1077, 1087, 1097, 1127, and 1230 on the base. Now the question is the best way to get the corrections to the Reach. I'm sending RTCM up to rtk2go, so I can enable ntrip on the Reach itself if it has internet access. I have tried bluetooth and using ntrip client on the phone, but I've have no luck with bluetooth on the Reach. Just doesn't connect.
torriem is offline  
post #6 of 12 (permalink) Old 04-04-2019, 08:58 PM
Senior Member
 
Join Date: Jan 2018
Location: P.E.I. Canada
Posts: 189
Mentioned: 1 Post(s)
Quoted: 80 Post(s)
That's great to hear. I might have to try something similar in the future.

I've been able to get the Reach RS+ to send its location to my phone via bluetooth and enabling mock locations but I've never tried it the other way around with Lance Lefebure's NTRIP client. Hopefully it's something simple. Bluetooth is always finicky.
WTalen is offline  
post #7 of 12 (permalink) Old 04-05-2019, 01:55 AM Thread Starter
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,368
Mentioned: 5 Post(s)
Quoted: 828 Post(s)
I got things soldered up and stacked nicely. The SimpleRTK2 is perfect for this, since it's an Arduino shield already. Everything is powered by a common 5v rail, which will be fed into the 5v in pin on the SimpleRTK. The SimpleRTK does not produce enough power to run the radio (requies 1 amp). The arduino might be able to, but that's a lot of load in the linear regulator. So I'll power this with an external 5v power supply.

The SimpleRTK2 sends rtcm3 over uart1, to pin 1 of the arduino on the bottom. The arduino injects 1008 messages and sends all the data back ip pin 9, which is connected to the radio's data in. The radio is a 1 watt 900 Mhz module from Digi that I salvaged from some other obsolete electronics (9Xtend, obsoleted by SX pro), running the hopping firmware at 112500 bps over the air. I will be using the Digi SX (10 mw) module on the rover unit(s), again with hopping firmware.

I'm just going to get it mounted in a box and then it will be ready to install in my shop. I'm not sure how long the GPS antenna cable can be (the antenna comes with a 15' cable), so it will likely be mounted inside the shop up near the roof. Eventually I might add an ESP32 board running ESPRTK to push to an NTRIP caster. For beta testing it will be radio only for now (I can always bridge to ntrip caster on a PC with another radio receiver plugged into USB).
Attached Images
File Type: jpg IMG_20190404_213857213.jpg (548.5 KB, 23 views)
File Type: jpg IMG_20190404_213949780.jpg (590.5 KB, 19 views)
File Type: jpg IMG_20190404_214001276.jpg (946.5 KB, 17 views)
File Type: jpg IMG_20190404_214014270.jpg (702.6 KB, 18 views)
Kaupoi, holgerhey, WTalen and 2 others like this.

Last edited by torriem; 04-05-2019 at 01:59 AM.
torriem is offline  
post #8 of 12 (permalink) Old 05-20-2019, 11:27 AM
Junior Member
 
Join Date: May 2019
Location: France
Posts: 1
Mentioned: 0 Post(s)
Quoted: 0 Post(s)
Congratulations for your achievement, how far do you think you can transmite with the 1 watt module
nutnut is offline  
post #9 of 12 (permalink) Old 05-20-2019, 03:15 PM Thread Starter
Senior Member
 
Join Date: Sep 2009
Location: S. AB
Posts: 3,368
Mentioned: 5 Post(s)
Quoted: 828 Post(s)
It's really just limited to line of sight. According to the Digi literature, you should be able to get up to 100 km and still get a coherent signal, if there are no obstacles between the transmitter and receiver. So it depends on your terrain and how tall your antenna mast is. At only about 8 metres, I can reach for several km easily, except for a few areas where hills block the line of sight. I plan to install the transmitting antenna on top of my shop on a small mast. Should everywhere on my farm, at most a few km. A nice tall 30 metre mast would be even better, and probably reach about 15-20 km in my flat country.

Another alternative for the difficult-to reach areas is to switch over to NTRIP over cell phone with a bluetooth serial adapter on the rover GPS. So far I'm having a hard time getting my cheap bluetooth serial modules to connect to my android phone though.
torriem is offline  
post #10 of 12 (permalink) Old 05-20-2019, 03:38 PM
Senior Member
 
Join Date: Nov 2016
Location: Austria
Posts: 733
Mentioned: 3 Post(s)
Quoted: 295 Post(s)
https://github.com/eringerli/RpiNtripBase

there is a ready to use base with ntrip server including your 1008 inject for raspberry pi.

thanks to christian of the agopendevelop team!

torriem, dairytech and Tooki57 like this.

Questions on agopengps? Just look into the wiki at
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
. Thanks to all contributors!

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Andreas Ortner is online now  
Sponsored Links
Advertisement
 
Reply

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the The Combine Forum forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in













Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofarm A5 base station power supply nutcase Technology 1 02-05-2018 11:01 PM
GPS Field Base Station H.F.L For Sale/Want to Buy 0 03-28-2016 10:16 PM
trimble base station inconsistency Notinteresting Technology 6 10-06-2015 09:20 AM
WTB Trimble RTK base station farmer 4 ever For Sale/Want to Buy 1 08-31-2012 05:47 PM
AutoFarm Base Station jsc77 For Sale/Want to Buy 0 07-07-2011 09:38 PM

Posting Rules  
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome