Home › Forums › Forums › Technical Support for BerryGPS and BerryGPS-IMU › Receiving No Data
- This topic has 9 replies, 4 voices, and was last updated 2 years, 6 months ago by richardp.
- AuthorPosts
- January 28, 2021 at 12:13 pm #16549musch711Participant
Hi,
I’m trying to connect the Berry GPS-IMU to a Raspberry Pi 4 using the QWIIC connector. The led on the GPS is lit green, but I’m receiving no data on serial0 (using cat /dev/serial0 hangs). I’ve included some diagnostic output below. I’d appreciate any suggestions or advice.
Thanks,
Steven
pi@raspberrypi:~ $ dmesg | grep tty
[ 0.000000] Kernel command line: coherent_pool=1M 8250.nr_uarts=1 snd_bcm2835.enable_compat_alsa=0 snd_bcm2835.enable_hdmi=1 video=HDMI-A-1:1920x1080M@60,margin_left=48,margin_right=48,margin_top=48,margin_bottom=48 smsc95xx.macaddr=DC:A6:32:D5:5D:CE vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[ 0.001057] printk: console [tty1] enabled
[ 1.238296] fe201000.serial: ttyAMA0 at MMIO 0xfe201000 (irq = 29, base_baud = 0) is a PL011 rev2
[ 1.244976] fe215040.serial: ttyS0 at MMIO 0x0 (irq = 30, base_baud = 62500000) is a 16550January 28, 2021 at 12:58 pm #16550Mark WilliamsKeymasterYou will need to have the BerryGPS-IMU sitting ontop of the Raspberry Pi GPIO to get access to the GPS data via serial
Mark --OzzMaker.com --
January 28, 2021 at 2:19 pm #16551musch711ParticipantHi Mark,
I thought according to this, the QWIIC connector could serve as an alternative instead of mounting the IMU directly on top and soldering the connection. Is that not accurate?
Thanks,
Steven
January 28, 2021 at 2:44 pm #16552Mark WilliamsKeymasterSorry if it wasn’t clear. ill make sure that page gets updated.
If you connect via QWIIC connector only, you would only be able to access the GPS module via i2c (you would need to solder a couple of jumpers on the back to enable this function). This means you would not be able to use GPSD as GSPD relies on serial. We are trying to come up with a way to make it work with GPSD via i2c.
You can however, get lon,lat, speed, etc.. via i2c using
Here is some python code I have been playing around with;import time import json import smbus import logging BUS = None address = 0x42 gpsReadInterval = 0.1 LOG = logging.getLogger() GPSDAT = { 'strType': None, 'fixTime': None, 'lat': None, 'latDir': None, 'lon': None, 'lonDir': None, 'fixQual': None, 'numSat': None, 'horDil': None, 'alt': None, 'altUnit': None, 'galt': None, 'galtUnit': None, 'DPGS_updt': None, 'DPGS_ID': None } def connectBus(): global BUS BUS = smbus.SMBus(1) def parseResponse(gpsLine): global lastLocation gpsChars = ''.join(chr(c) for c in gpsLine) if "*" not in gpsChars: return False gpsStr, chkSum = gpsChars.split('*') gpsComponents = gpsStr.split(',') gpsStart = gpsComponents[0] if (gpsStart == "$GNGGA"): chkVal = 0 for ch in gpsStr[1:]: # Remove the $ chkVal ^= ord(ch) if (chkVal == int(chkSum, 16)): '''for i, k in enumerate( ['strType', 'fixTime', 'lat', 'latDir', 'lon', 'lonDir', 'fixQual', 'numSat', 'horDil', 'alt', 'altUnit', 'galt', 'galtUnit', 'DPGS_updt', 'DPGS_ID']): GPSDAT[k] = gpsComponents''' print gpsChars #print json.dumps(GPSDAT, indent=2) def readGPS(): c = None response = [] try: while True: # Newline, or bad char. c = BUS.read_byte(address) if c == 255: return False elif c == 10: break else: response.append(c) parseResponse(response) except IOError: time.sleep(0.5) connectBus() except Exception, e: print e LOG.error(e) connectBus() while True: readGPS() time.sleep(gpsReadInterval)
Mark --OzzMaker.com --
January 31, 2021 at 3:47 am #16556musch711ParticipantHi Mark,
Thanks for the follow up with code sample! I enabled i2c and was able to get some readings from it; however, given what you mentioned about additional soldering for GPS, I’m currently limited to the accelerometer. I used the following code: https://github.com/ozzmaker/BerryIMU/blob/master/python-BerryIMU-gryo-accel-compass/berryIMU-simple.py to get the reading.
Thank you for your help and I’ll follow up if I have additional questions!
-Steven
March 17, 2021 at 6:06 am #16649vovacooperParticipantHi Mark,
i got the V4 GPS-IMU module, trying to connect it to Jetson via qwiic (i2c), all working well but the GPS :(.i saw that u wrote “If you connect via QWIIC connector only, you would only be able to access the GPS module via i2c (you would need to solder a couple of jumpers on the back to enable this function)…”
Unfortunately i cant find any place that specifies which jumpers i need to solder.
Can u please explain which jumpers i need to solder for the GPS to start working via I2C?
Thanks
March 17, 2021 at 3:23 pm #16655Mark WilliamsKeymasterHi, we are in the middle of writing up a guide on this, it should be posted soon.
But, in summary.. itsJP7
&JP8
Mark --OzzMaker.com --
March 18, 2021 at 1:20 am #16657vovacooperParticipantSorry to bother you but its very frustrating that you just writing a guid on a product i already have…
It looks like the JP7 and JP8 is has a connection already (without soldering)…
Do i need to there it off?do i need to connect JP7 to JP8?
What should i do to make the GPS work with I2C?
thanks
March 18, 2021 at 2:12 am #16658vovacooperParticipantfound it 🙂
it was JP10 + JP11 and not JP7 + JP8
🙁
March 18, 2021 at 1:59 pm #16659richardpParticipantYou are right! I am so sorry.. not sure what I was looking at 🙁
Richard --OzzMaker.com --
- AuthorPosts
- You must be logged in to reply to this topic.