Injekt RTCM 1008

Since the neighbor might want to get his almost new NH (trimble) on my base I have tried to follow this guide GitHub - eringerli/RpiNtripBase on Pi Zero which is connected to F9P via USB, I like get RTCM 1005, 1077, 1087, 1097, 1027 and 1230 through to, but can’t get 1008 added, do some have the complete start command for Raspberry pi?
I have tried this and several others but do not work:
sudo systemctl enable baseProxy@115200.service
sudo systemctl start baseProxy@115200.service
sudo systemctl enable ntripcaster.service
sudo systemctl start ntripcaster.service
sudo systemctl enable logrotate-ntripcaster.timer
sudo systemctl start logrotate-ntripcaster.timer
sudo systemctl enable str2str.service str2str-injectrtcm1008.service
sudo systemctl start str2str.service str2str-injectrtcm1008.service
thanks in advance.

maybe the problem is here … are you trying to start 2 service ? maybe it should be :

sudo systemctl enable str2str-injectrtcm1008.service

maybe i m wrong …

I’ve also tried that and I only send RTCM3 on usb port

I had also experienced a failure a few months ago trying to make this work. Please, keep us informed here of your progress, failure and success with this.

in win 10 I have tried with STRSRV ver. demo5 b33b, where I convert RTCM 3 to RTCM 3 with message type 1005(1),1006(1),1008(1),1077(1),1087(1)),1124(1),1230(1) then I get 1008 but lose 1230.



There is some new (dec 2019) explanation on 1008 and trimble fix with f9p in post 42 here:

Sure two F9Ps compensate already because they are identical and have the same characteristics when it comes to measuring the biases in the signal. With identical receives, the 1230 message isn’t even required to fix with Glonass. But what about different manufacturers of receivers? After all that’s the whole point of the 1230 message. I wonder if they don’t understand the question. Most likely it’s too much work for the price point they are selling at.

I’ve failed miserably with RPINtripBase. Just won’t work for me. It will send a source table but nothing else. Maybe the raspberry pi I am using is too old? It’s one of the first! :grimacing:

I’ve got ESP32-XBee working just fine on an esp32 dev board and if you need RTCM1008 then another esp32 board with code that I think originated from @torriem, modified for the ESP, positioned in between the F9Pand the ESP running ESPXbee will work a treat.

Probably the ESP32 solution is better anyway. More robust and instant on. No waiting for Linux to boot, or dealing with an SD card that gets corrupted.


If the U-Blox inputs to ESP32 Serial2 and output is on Serial0 the the ESP can send it’s output to a windows box running snip via USB or another ESP running ESP-32XBee via TX0 without any intervention.

Mine seems to be working really well now. No libraries necessary but I couldn’t get it to work on the esp until I changed the dummy 1008 message to a byte array.

I installed simpleRTK with an arduino UNO (torriem’s ​​ino inside), and send this to ESP32 with exp32-xbee inside. And here’s the result :
Capture d'écran 2020-03-08 23.49.56

Thanks to you !

Been testing the F9P as base with RTCM 1008 injected.
First my F9P was out in the shed with by my Trimble “production base”:
Geodetic antenna → Antenna splitter → F9P → Arduino Uno with torriem’s injector → SNIP caster in a small old embedded Intel atom WIN box → cellular router with DDNS internet-address.

It worked very well. “Like a toilet in a train” as we say in our language.

Then I started to learn the open source “Standard linux caster”. The one eringerli etc are using:
GitHub - eringerli/RpiNtripBase
It can be used for more streams than a free SNIP Lite which is limited to 3 streams.

So got a RaspberryPi 4 for that.
Been playing now with the F9P and Pi in my office.
The small patch anteenna just on the roof outside. Not the best place for an antenna (under some trees …), but it should work well enough to test the caster robustness. My office has it’s own cellular router with (no-ip) DDNS.

After I got everything figured out I have been feeding the Linux ntripcaster with 3 outside ntripserver streams from my “production base”.
And they are available very fast after the base Pi is started.

Linux caster seems to work well with several clients from different LAN and cell-connections.
4-5 caster streams and 4 - 7 clients goes well.

So far so good.

With the F9P hooked to the PI by USB port:
Been using the -script (by torriem) that also eringerli has used in his git:

seemed to cause repeatedly timeouts. This stream “killed itself” quite often as could also be read from ntripcaster.log.
Sometimes several times on hour and for different lengths. Often several minutes (=way too much).

Without injecting the 1008 worked better.

After studying the RTCM 3.2 standard (found from net) and trying to learn some Python I came to the idea, that the problem might be the first 6 bits in the RTCM message. If they are other than zero then the calculated message_length gets very high → script reads too many bytes.

if eg is
a= 11110111
b= 10101010
(a << 8) + b makes 63402

But as in the RTCM message the first 6 bits after the Preamble 11010011 = 0xd3 are
Reserved and not part of the next 10 bits who tell us the Message Length.
So I tried to mask them out by a simple:
((a & 0b00000011) << 8) + b which makes 938

Reading 63402 bytes instead of 938 bytes would most likely make a mess and cause a timeout.

In the original code I changed the row:

length = (length_data[0] << 8) + length_data[1]


length = ((length_data[0] & 0b00000011) << 8) + length_data[1]

And no more timeouts!

I do not know if this a proper way to do this, but seems to help.
Hopefully torriem can give a comment about this.

If I have understood right the rtcm1008 inject code for Arduino works better as it only reads in the message until it finds the next Preamble 0xd3 or how?

It has been over 35 years that from the time I did some Turbo Pascall programming for my ag-engineering master theses.
Have’t done coding since that.
But sure this was an interesting learning experience. Took quite a lot time tough…


Did you use a level shifter in between the arduino and the ESP32?

yes 3v3 ioref everywhere

The ESP32 is obviously 3v3 and the ardusimple board Io can be set by IOREF but I didn’t think and uno was selectable with IOREF. I thought the uno IOREF was actually a 5v output. :thinking:

OH ! F***** ! I have checked ! And you’re right !

I was lucky that my ESP supports 5V! It has been working for 2 days. I think that as soon as I have some time for that, I would replace the UNO by an equivalent working at 3v3.
Thanks for the tip !

Good catch. You’re absolutely correct. I looked at the arduino code on my github and it correctly ensures that only the least significant 10 bits of those two bytes are looked at. The python code did not, so that’s a definitely bug! And we hate those kinds of intermittent bugs too!

You can fix it the way you’ve done it, or you can “and” the length with 0x03ff (which is 0000001111111111 in binary).

length = length & 0x03ff

Either method is correct. I’ll see if I can edit that old post on the combine forum to correct the code. Or post a new one for the record.

EDIT: oops I had 0x07ff. And that’s what’s in my arduino code too. That would seem to be a bug too.

The ESP8266 is definitely 5v tolerant on the I/O pins, due to the nature of the open collector (or is that “open drain?” I forget) interface of the GPIO pins. However I cannot find any definite information on the ESP32. Some suggest it can tolerate 5v, provided the current is low enough to not damage the internal protection of the ESP32. The key of course is the amount of current that the arduino’s pull-up resistors are putting on those lines, which you don’t have much control over.

Maybe I can just use a voltage divider bridge with 2 resistors … It’s only 1 wire between UNO and ESP . Cheaper than a nano 33 or teensy …

1 Like

Level shifters are very cheap but I just used an esp32 instead of an arduino.

Your code edit is interesting. I’ll read my esp32 version to compare. I modified code I found to get it to work on the esp. not sure where I found it🙈