-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I2C example #15
Comments
Hi @beriberikix, I don't have this particular GPS module but i'll try to order one. It might be a while before I get my hands on it, though! From a brief look, you'd have to replace this part: libnmea-esp32/example/main/nmea_example_main.c Lines 59 to 64 in 7a2ab38
with something like int read_bytes = 0;
while(read_bytes < UART_RX_BUF_SIZE - total_bytes) {
char c;
// i2c_master_read_slave is from esp-idf i2c_example_main.c
if (i2c_master_read_slave(i2c_num, (uint8_t*) &c, 1) != ESP_OK) {
break;
}
if (c == 0) { // no more bytes to read
break;
}
buffer[total_bytes + read_bytes] = c;
read_bytes++;
}
if (read_bytes == 0) {
vTaskDelay(pdMS_TO_TICKS(10));
continue;
} plus the initialization of I2C at the top of app_main, similar to the i2c_self_test example. |
I got the GPS in question and will try to add an example in the next couple of weeks. |
@beriberikix you are welcome to try Ribbit-Network/ribbit-network-frog-hardware#16. I haven't had a chance to test if UART still works after these changes, but I2C seems to work. |
Hi @igrr ! Thanks so much for this implementation. I'm trying it out for Ribbit Network, but it seems like the only data coming from the PA1010D GPS is in the form of GPGSA and GPGSV sentences, which don't contain position data (reference). It seems like the device is sending other sentence types, although, weirdly, I can't find too much information about these other sentence types (GLGSA, GNRMC, GNVTG, GNGGA...) You can see the code I'm using here Did you manage to receive other sentence types from your PA1010D GPS? If so, do you have an idea about what I'm doing wrong? |
Seems like GNRMC data may be what I want from the device (GNRMC reference) -- I guess this isn't currently supported in the NMEA package. Do you have a suggestion for a workaround/another package to use? |
@akhilgupta1093 Do you specifically need GNRMC (i.e. GPS+GLONAS) and not GPRMC (GPS)? If you want to configure the receiver to send particular sentences or enable/disable particular talkers (GPS/GPS+GLONAS) you need to send some commands to it. The commands are vendor-specific. Adafruit has made the command reference for this module available here. You can also check their tutorial, it has a few sample PMTK commands. |
I've opened an upstream PR to add support for |
Thanks for the references, I'll take a look at enabling/disabling particular talkers. We only need location data, not satellite data, so GP* would be good enough for us. In any case, I look forward to your PR being merged. Thanks a ton for your help! |
@igrr I'm having a little trouble configuring the receiver like you mentioned above (the examples are in circuitpython, I'm using esp-idf and c). I've decided to wait for your |
@akhilgupta1093 I have updated #16, please give it a try. |
@igrr Sorry, I'm currently running |
You can modify the idf_component.yml in your project to install the component from a git repository, until a new version is released: dependencies:
libnmea-esp32:
git: https://github.com/igrr/libnmea-esp32.git
version: feature/i2c (or |
@igrr Thanks for the support! I have it working on my side, but the sentences are all giving zero values, like below. Any idea why this might be?
|
Are you sure the module actually has a fix on the satellites? I have put my module next to the window and it took about 5 minutes for the module to acquire a fix. (I have a relatively clear view of the sky outside; if you have other buildings nearby it may take even more time.) |
Thanks for the tip, seems like there's data being ingested now, but for some reason it's facing an error trying to read the data bytes. (here's my branch for reference) Getting this error log repeatedly:
|
Does it fail all the time, or just occasionally, or does it work for a while and then start failing? From the I2C driver code, I see ESP_FAIL being returned when the I2C FSM gets stuck. Usually this indicates some noise on I2C lines. Please check your PCB or wiring to make sure the connections are reliable and have pull-up resistors. |
Ah it worked after disconnecting and re-connecting the wires. Thanks so much for all your help! Seems like the integration is complete on our part. |
Hi Ivan! Thanks for making this port to the new component system :)
Would it be possible for someone to create an I2C example? I'm interested in a specific use case to support the PA1010D which is used in the open source Ribbit Network project (see more here.)
The text was updated successfully, but these errors were encountered: