ArmDeveloperEcosystem / lorawan-library-for-pico

Enable LoRaWAN communications on your Raspberry Pi Pico or any RP2040 based board. 📡
BSD 3-Clause "New" or "Revised" License
125 stars 47 forks source link

'gpio_set_irq_enabled_with_callback' from incompatible pointer type #21

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hello,

I purchased a Pico-LoRa-SX1262-868M and I'm trying to get it to run with the code-examples from the Waveshare website https://www.waveshare.com/wiki/Pico-LoRa-SX1262-868M which would be updated to be compatible with the Pico-LoRa-SX1262-868M module I use the main.c example which is for the sx1262 radio module.

main.c.txt

Unfortunately it does not work for me.

While building I got the next warning ...

/home/pi/pico-lorawan/src/boards/rp2040/gpio-board.c: In function 'GpioMcuSetInterrupt': /home/pi/pico-lorawan/src/boards/rp2040/gpio-board.c:68:73: warning: passing argument 4 of 'gpio_set_irq_enabled_with_callback' from incompatible pointer type [-Wincompatible-pointer-types] gpio_set_irq_enabled_with_callback(obj->pin,GPIO_IRQ_EDGE_RISE,true,irqHandler); ^~~~~~ In file included from /home/pi/pico-lorawan/src/boards/rp2040/gpio-board.c:8: /home/pi/pico/pico-sdk/src/rp2_common/hardware_gpio/include/hardware/gpio.h:384:103: note: expected 'gpio_irq_callback_t' {aka 'void ()(unsigned int, long unsigned int)'} but argument is of type 'void ()(void *)' void gpio_set_irq_enabled_with_callback(uint gpio, uint32_t events, bool enabled, gpio_irq_callback_t callback);

It seems to be a conflict between the software delivered in the example-code (/home/pi/pico-lorawan/src/boards/rp2040/gpio-board.c) and pico-sdk (/home/pi/pico/pico-sdk/src/rp2_common/hardware_gpio/include/hardware/)

Despite this issue I copied the uf2-file to the board but it will not connect to the network ...

Pico LoRaWAN - OTAA - Temperature + LED

Initilizating LoRaWAN ... success! Joining LoRaWAN network ................................

I am not a code-engineer and doing this just for hobby but I would appreciate some help to solve this issue.

Thank you in advance,

Eric

P.S. Is there a example code in micropython or circuitpython which makes it easier to code for people like me ;-)

sandeepmistry commented 2 years ago

Hi @DIY62,

This library does not currently support the SX1262 that is on the Waveshare board. I suggest you contact the Waveshare team for support.

You can also see @ThomasLeister's fork for the changes needed: https://github.com/ThomasLeister/lorawan-library-for-pico/tree/add-waveshare-sx1262-support

ghost commented 2 years ago

Thanks

pinipon1 commented 1 month ago

Thanks

Hello @DIY62 and everyone seeing this. Im having the same issue. Did you solved the problem? Did you change the library?

Thank you in advance, Diogo