Drifting away from Arduino


it’s my first post here and have to say: great job!This library has been a life saver in many of my lora-related projects and it so beautifully maintained that it can only be a role-model!

Now, I have come accross a couple of projects that require an LMIC functionality but do not support Arduino. They require bare-metal C in their native SDK. I’ve been thinking of porting this library for them. But, before I proceed with the exhausing work like that, I’d like to check if maybe someone has already done that? Do we have LMIC-library somewhere that works outside Arduino?

I have seen the ibm-lmic, a tracking repository of IBM, but it hasn’t been updated since 2016. Is it compatible with latest LoRaWAN / TTN API? IBM sadly, doesnt provide any source code related to the LMIC anymore.

I assume, whatever I do, I need to make sure that some functions like SPI communications with sx1276 need to be implemented on my side, using my SDK. Is there something else that is platform-dependent that I need to keep an eye on?



This should work. You need to re-implement the hal.cpp functions, basically; but you need to go back to basics to some degree (rather than trying to emulate Arduino functions, you should look at the original requirements and re-implement in terms of your platform.) Perhaps we should set up a discussion topic, because it’s not very hard. I did this for a RISC-V project for our (never mass produced) Catena 4710; the work should be relatively easy to re-use.

Ok, cool. Happy to hear it’s interesting for you as well!

You mind sharing a bit more of what basics should I go back to? Except basic SPI write/read implementation, what else do you have in mind?

I mean that you should not try to adapt the Arduino code in hal.cpp; you should instead go back to the definition of the HAL routines (in the Word doc, and to a lesser degree visible in the LMIC header file and the original IBM LMIC. Re-implement; don’t succumb to the temptation to “port” or add wrappers on the existing, highly Arduino-specific “HAL”. It’s not really a HAL , it’s an OS adaptation layer, and the Arduino enviroment is only barely an operating system.

Hey thanks for the idea. It sounds like an interesting project for another time. Right now, I have found a LoRaMAC library by Semtech that is already implemented for my architecture and SDK. I’m gonna stick to it till I see my project’s end.

That’s fine, good luck!