Arduino LMIC library updated


#42

Try changing the TX_INTERVAL parameter


#43

Tnx! I will look for it later today at the hackerspace meetup.


BIG ESP32 / SX127x topic part 1
#44

Ok sorry but I can not find that setting. In what file is it?


#45

@paulb in the sketch itself. Not the library


#46


line 61


#47

Thank you. I seem to be using a totally different sketch, maybe still the example of the old version.


#48

I just uploaded a sketch that doesn't use the scheduling mechanism but that sends it right away. Ok, technically it queues it first until the first duty cycle window arrives, but that's just seconds.


#49

Great!!


#50

I also use the same sleeping mechanism to make delays with lowering power consumption.
instead of duplicating the statements, I made a loop, also to modify the delay easily


#51

yeah, this was a qnd version which I wasn't planning to upload yet. But since paul got stuck, why not. I'm creating a new generic github repo which will contain better examples than the tijnonlijn account. Please feel free to add some stuff. For instance I also want to separate the reading and sending to functions like readSensor() and such. And I promised matthijs to make a walk through. And i'd like to make a code generator merging a template, node connection info, node pin mapping info, and fragments for specific sensors. and.. and..

oh well. Time.. :wink:


#52

Inserting code now, brb
-edit this is going to take a bit
'LMIC_UNUSED_PIN' was not declared in this scope
Maybe tomorrow :wink:


#53

try to copy the lmic version from my github, in case it's not identical


#54

I solved the UNUSED_PIN error. Is it possible that this sketch uses things that are not defined in the Teensy LC?
call of overloaded 'print(ostime_t)' is ambiguous
-edit
ok hang on, switching from arduino-lmic-v1.5-master to arduino-lmic-master does indeed make a lot of difference but now I have again new errors.
Almost there I only have this now:
'for' loop initial declarations are only allowed in C99 mode
for (u1_t i = 0; i < len; i += 16)

I found a github thread about this:


Where it states This is fixed in Arduino 1.6.5 and above.
The thing is, I have Arduino 1.6.12.
So I also found a discussion above in post 19 of this thread about C99. It seems easier for me to just move away from Teensy LC. There does not seem to be a clear cut solution.


(Matthijs Kooijman) #55

The for-loop thing was indeed fixed in the normal Arduino cores in 1.6.5, but the problem is still present in the Teensy core you are using. I'm not sure if this is fixed by now in the latest teensy core, it could be that you're just using an outdated version.


#56

I drilled into the Arduino app (1.6.12) in OSX, found the teensy/avr folder with the platform.txt in it.
There is no compiler.c.flags setting with or without -std=gnu11like I see in some of the other boards. For me this is a dead end so I am now working out how to connect an RFM with the pinout to a NodeMCU 1.0 and drop the Teensy (into a canal, plenty around here in Amsterdam).


#57

@paulb
did you tried this fork?

Works without DIO pin connected worth give it a try, I'm using it on ESP8266


#58

Without DIO0,1&2? Just leave them disconnected?
I got this snippet from the description:
"Both modes need only 2 pins, but the tranceiver does not allow mapping them in such a way that all needed interrupts map to the same 2 pins. So, if both LoRa and FSK modes are used, all three pins must be connected."
(https://github.com/tijnonlijn/RFM-node/tree/master/arduino-lmic-master)


(Matthijs Kooijman) #59

@paulb, the fork linked contains some changes that allow it to work without any DIO pins connected (at a small performance penalty). Eventually, changes like those will also be integrated in the main version, but they need a bit more cleanup before that.


#60

@paulb

correct no need to connect any DIO for Lora with this fork, see pin mapping section on the dedicated readme

since you work with teensy, should have no incidence in term of performance :wink:


#61

@Charles, @matthijs, Thanks for the info and tips.
I'm connecting and flashing my NodeMCU v1 at the moment and this is how I am going to try it:
// Pin mapping
const lmic_pinmap lmic_pins = {
.nss = 26,
.rxtx = LMIC_UNUSED_PIN,
.rst = LMIC_UNUSED_PIN,
.dio = {LMIC_UNUSED_PIN, LMIC_UNUSED_PIN, LMIC_UNUSED_PIN},
};

Also, I identified the following pins:
RFM MCU
MISO D6
MOSI D7
SCK D5
NSS D8
Plus of course GND, 3v3 and ANT.
Please correct me if I am wrong.