OneWire library on Boron


#1

I have a working sketch on my new Boron, and was interested in adding a OneWire sensor. I used the library manager to add the OneWire library to my project, and it appeared to work (it added the library to the project and the #include at the beginning of the file). But now when I compile, I get:

lib/OneWire/OneWire.h:99:21: ‘STM32_Pin_Info {aka struct NRF5x_Pin_Info}’ has no member named ‘gpio_peripheral’


#2

Did you get this figured out?
I’m getting the same error on the Encoder Library.

#define PIN_TO_BASEREG(pin)             (&(HAL_Pin_Map()[pin].gpio_peripheral->IDR))
#define PIN_TO_BITMASK(pin)             (HAL_Pin_Map()[pin].gpio_pin)

#3

Make sure you have the 2.0.3 version of the OneWire library. It has support for mesh devices.


#4

It started working for me after I opened a ticket and particle updated the OneWire library


#5

I had the same error trying to use the OneWire library an Adafruit BNO055 library that I had previously had working on Photon. Now with my Argon, it is giving this error:

lib/OneWire/OneWire.h:99:21: 'STM32_Pin_Info {aka struct NRF5x_Pin_Info}' has no member named 'gpio_peripheral'

lib/OneWire/OneWire.h:103:21: 'STM32_Pin_Info {aka struct NRF5x_Pin_Info}' has no member named 'gpio_peripheral'

I confirmed that the Onewire library is version 2.0.3, and I re-added it using the Web IDE to the project. Has anyone else had similar errors with this library on the Argon?


#6

Can you post (or PM) a SHARE THIS REVISION link to your project?
I can’t see a Adafruit_BNO055 library in the Web IDE libraries list.


#7

Thanks @ScruffR!

Here’s the link to the revision of the code for the BNO055 that I’ve been using to test: https://go.particle.io/shared_apps/5c1025f4fcc0710557002120

The library I was using wasn’t public - I had just made a private version of this one: https://github.com/nrobinson2000/particle-BNO055

To share the revision, I had to make the library public, so it is now available. I just wanted to acknowledge that it wasn’t my work to port the library over - thanks to @nrobinson2000 for the original port!

Before posting, I confirmed that this sample code does still work on a Photon - my Photon was able to print out successfully to the serial monitor with live sensor data. I tried again with the Argon, and it gave me the same error with the OneWire library that I included in my previous message.

Thanks for taking a look at this!


#8

I believe the problem is in the library.properties for the Adafruit_BNO055_Photon library:

dependencies.onewire=2.0.1

It depends on version 2.0.1, but version 2.0.3 is required for mesh compatibility.


#9

Thanks @rickkas7!

That was the problem - I appreciate you spotting it. I’ve updated and published the BNO055 library to use OneWire 2.0.3, and that seems to have made it work on my Argon now.

Anyone else who like to check, here’s the latest revision: https://go.particle.io/shared_apps/5c10537f63a1cadee0000520

Thanks to everyone who helped, and my apologies for hijacking this thread a bit. It looks like the OneWire 2.0.3 library should be working fine on my mesh devices.


#10

Thanks for using my port. I compressed the library, so you shouldn’t need to include Adafruit_Sensor as I already included the class in the particle-BNO055.h header file.