Replies: 4 comments
-
Hi @rush0815 I'm glad PyGPSClient is providing useful for you. To receive frequency spectrum data, you'll need to enable MON-SPAN messages on your remote SAM-M10 via a CFG-VALSET command with the "CFG_MSGOUT_UBX_MON_SPAN_USB" (0x2091038e) or "CFG_MSGOUT_UBX_MON_SPAN_UART1" (0x2091038c) configuration keywords You reference the change made in 1.3.29 to allow UBX configuration commands to be passed over socket as well as serial connections, but the release notes included this important caveat "provided the receiver's TCP client at the other end supports this". Unfortunately the Assuming you have physical access to your SAM-M10 receiver, could you not configure it via USB/UART, save the configuration to non-volatile memory (CFG-CFG) and then run it remotely? Not sure I fully understand your statement "Conncting the same module, also via USB, to the remote raspberry pi again gives me only NMEA and no UBX and thus no configuration possibility" - unless you've explicitly configured the module to block UBX over USB, I'm not clear why you would get 'NMEA and no UBX' via the RPi - can you elaborate? Sorry I can't be more helpful at this point. |
Beta Was this translation helpful? Give feedback.
-
Hi and thank you very much for you quick response! I am quiet new to programming ublox GPS modules. All I did until now is just using it. So please be gentle with me ;-) Yes, I have physical access to the M10. It would be enough for me to enable the MON-SPN messages only once and have them always on the USART NMEA stream included, even after a reset/reboot of the module. As I mentioned, the module is connected to a raspberry pi zero in headless mode. But I have full ssh root access to it so this is not the problem. Could you explain the first paragraph in more detail? Maybe you could provide me an ready to use command line. That would be cool :-) Thank you for your time! PS: |
Beta Was this translation helpful? Give feedback.
-
Hi again @rush0815 OK let's take each of your points in turn...
"""
Python code snippet to configure UBX receiver (Generation 9+)
"""
from serial import Serial
from pyubx2 import (
SET_LAYER_BBR,
SET_LAYER_FLASH,
SET_LAYER_RAM,
TXN_NONE,
UBXMessage,
UBXReader,
escapeall,
)
PORT = "/dev/ttyACM0"
BAUD = 38400
TIMEOUT = 3
ID = "MON_SPAN" # UBX message identity
RATE = 1 # 1 = on, 0 = off
# set configuration in volatile and non-volatile memory layers (BBR = battery-backed RAM)
MEM = SET_LAYER_RAM | SET_LAYER_BBR | SET_LAYER_FLASH
# enable UBX message on USB and UART1 ports
cfgData = [
(f"CFG_MSGOUT_UBX_{ID}_USB", RATE),
(f"CFG_MSGOUT_UBX_{ID}_UART1", RATE),
]
# create CFG-VALSET command
msg = UBXMessage.config_set(MEM, TXN_NONE, cfgData)
# print parsed and binary message formats
print(msg)
print(escapeall(msg.serialize()))
try:
# configure serial port
with Serial(PORT, BAUD, timeout=TIMEOUT) as stream:
# send command to receiver
b = stream.write(msg.serialize())
print(f"{b} bytes sent to {PORT}")
# stream data from receiver
ubr = UBXReader(stream)
for raw, parsed in ubr:
print(parsed)
except KeyboardInterrupt:
print("\nUser terminated") <UBX(CFG-VALSET, version=0, ram=1, bbr=1, flash=1, action=0, reserved0=0, CFG_MSGOUT_UBX_MON_SPAN_USB=1, CFG_MSGOUT_UBX_MON_SPAN_UART1=1)>
b'\xb5\x62\x06\x8a\x0e\x00\x00\x07\x00\x00\x8e\x03\x91\x20\x01\x8c\x03\x91\x20\x01\x29\xa2'
echo -ne '\xb5\x62\x06\x8a\x0e\x00\x00\x07\x00\x00\x8e\x03\x91\x20\x01\x8c\x03\x91\x20\x01\x29\xa2' > /dev/ttyACM0 Hope this helps. PS: By the way, there is a code example in the pyubx2 examples folder which illustrates how to plot frequency spectrum information from a binary file of UBX MON-SPAN messages using the popular |
Beta Was this translation helpful? Give feedback.
-
Thanks for the details infos According to
Python would be even greater :-) Using flask I could make all the stats public via http.... |
Beta Was this translation helpful? Give feedback.
-
First: Thanks for that gread u-center alternative for linux!
I want to use it for debugging the antenna performance of an remote raspberry pi with connected SAM-M10 (via USART) on an custom PCB.
Using your pygnssserver I am able to get all the NMEA messages straight into PyGPSClient. But no Configuration of the remote module is possible. Even reading after opening the configuration dialog is not possible (showing blue clock-symbol).
As you wrote in RELEASE_NOTES, version 1.3.29 should support remote configuration:
"Enhance stream handler to allow outbound writes to socket as well as USB/UART streams (requires pyubx2 >= 1.2.28). Allows users to configure or poll a remote receiver over TCP, provided the receiver's TCP client at the other end supports this."
I started the server with:
./gnssserver --inport "/dev/ttyAMA0" --baudrate 9600 --hostip 192.168.0.20 --outport 50012
Alternatively I tried a NEO-M8 locally (on a another computer via USB) to configure. That works great! Conncting the same module, also via USB, to the remote raspberry pi again gives me only NMEA and no UBX and thus no configuration possibility.
So my question is: How can I fully communicate with the SAM Module via TCP and transfer transparently all data from and to the GPS Module. I would like to see the frequency spectrum on PyGPSClient. These messages are supported by the GPS Module.
Thanks for your answer in advance!
Beta Was this translation helpful? Give feedback.
All reactions