@Felix
I got an answer from Thomas, so you can do it as you suggested.
about the topic of EUI64: I don't think, that it's no need having a hardware based EUID. It's possible to get some of them as "soft bulk"
It's not supported by the library and must be programmed in user space and then given to the LMIC to work with it.
That supposedly supports EUI64, hence the other request to add a pad for that device.Please use this https://github.com/matthijskooijman/arduino-lmic (https://github.com/matthijskooijman/arduino-lmic) updated library.
PCBs arrived and I assembled a panel.
If you want to order these before they become "official" just order the MoteinoMEGA-LoRa and mention in the comments you want the LMIC/EUI variant and I will send you this, and I will include the EUI chip for you to solder if you want the EUI64 MAC.
#include <Wire.h> //http://arduino.cc/en/Reference/Wire
void setup(void)
{
Serial.begin(115200);
Serial.print("wire init...");
Wire.begin();
Serial.println("done");
}
void loop(void)
{
Serial.println("Loop...");
readEEPROM_MAC(0x50, 0xF8); //0x50 is the I2c address, 0xF8 is the memory address where the read-only MAC value is
delay(2000);
}
void readEEPROM_MAC(int deviceaddress, byte eeaddress)
{
Wire.beginTransmission(deviceaddress);
Wire.write(eeaddress); // LSB
Wire.endTransmission();
Wire.requestFrom(deviceaddress, 8); //request 8 bytes from the device
while (Wire.available()){
Serial.print("0x");
Serial.print(Wire.read(), HEX);
Serial.print(" ");
}
Serial.println();
}
Should I soder these?
Pin mappings (through non-bridged solder jumpers):
DIO1=>D22, DIO2=>D21, RST => D3
Also on the RFM95 shouldn't it be DIO0 and DIO1?
Just got a new Moteino Mega.sorry that I was so lazy replying here.
/* Pin mapping for the new Moteino Mega R2 with solder bridges*/
const lmic_pinmap lmic_pins = {
.nss = 4,
.rxtx = LMIC_UNUSED_PIN,
.rst = 3,
.dio = {2, 22, 21}, // DIO0, 1, 2
};
Hi - what do the marked solder bridges do - sorry for the noob question
They are SMD 0805 pads for adding passives. Generally you don't need to worry about those. They are marked with || which would suggest they are for capacitors.
Interesting, the 3.3V one is obvioulsy for a decoupler, but a cap on the antenna? Was that some attempt at matching (or using 915MHz modules for 868MHz or something)?I put a cap pad cause that felt appropriate in Eagle. Could be used with a cap or inductor for matching I guess. I never used these myself, someone asked for these pads a while back.
I put a cap pad cause that felt appropriate in Eagle. Could be used with a cap or inductor for matching I guess. I never used these myself, someone asked for these pads a while back.OK. I suppose one possible use for that footprint might be to fit a 50R load resistor and not fit the antenna, that'll protect the output during development. Also the small stub would radiate a very little possibly simulating a distant transmitter.
My main question is do I need the EUI-64? What is it for?If you have to ask, my opinion is either you have to ask the LMIC library creators to make sure you have the best accurate answer, or you don't need it.
Is there anything thing that has changed since this thread?
You're welcome and thanks for the order.
Below's a sample native code that will read the MAC address from the included Microchip 24AA02E64 EEPROM (http://ww1.microchip.com/downloads/en/DeviceDoc/20002124F.pdf):Code: [Select]#include <Wire.h> //http://arduino.cc/en/Reference/Wire
void setup(void)
{
Serial.begin(115200);
Serial.print("wire init...");
Wire.begin();
Serial.println("done");
}
void loop(void)
{
Serial.println("Loop...");
readEEPROM_MAC(0x50, 0xF8); //0x50 is the I2c address, 0xF8 is the memory address where the read-only MAC value is
delay(2000);
}
void readEEPROM_MAC(int deviceaddress, byte eeaddress)
{
Wire.beginTransmission(deviceaddress);
Wire.write(eeaddress); // LSB
Wire.endTransmission();
Wire.requestFrom(deviceaddress, 8); //request 8 bytes from the device
while (Wire.available()){
Serial.print("0x");
Serial.print(Wire.read(), HEX);
Serial.print(" ");
}
Serial.println();
}
Should produce this output:
wire init...done
Loop...
0x0 0x4 0xA3 0xB 0x0 0x19 0x7F 0xB7
The bold part is the MICROCHIP identifier (constant), the italic part is the variable part (unique with each chip).
I am using this code on a Moteino Mega USB and the code loads and runs. I see the Loop... but not getting any value back. Nothing of the wire.read.
I am basically trying to figure out how to get the Device EUI from the Moteino to use with the LMIC library stuff for the things network.
Please use this https://github.com/matthijskooijman/arduino-lmic (https://github.com/matthijskooijman/arduino-lmic) updated library.
The DEVEUI must be changed in the user program (example/ttn.ino)
static const u4_t DEVADDR = 0x03FF0001 ; // <-- Change this address for every node!
and the SX variant in /src/lmic/config.h, which is newerdays set to SX1276 = RFM95W #define CFG_sx1276_radio 1
const lmic_pinmap lmic_pins = {
.nss = 4,
.rxtx = LMIC_UNUSED_PIN,
.rst = 3,
.dio = {2, 22, 21},
};
LMIC_setClockError(MAX_CLOCK_ERROR * 1 / 100);
LMIC_selectSubBand(1);
LMIC.dn2Dr = DR_SF9;
LMIC_setLinkCheckMode(0);
LMIC_setDrTxpow(DR_SF7,14);
everhamme,
Great, thanks for sharing that!
So no other hardware needed? Like the EUI64 chip for MACID?
Someone else was suggesting the FLASH-MEM (which incidentally also has a hardcoded 64bit ID) could be used the same way.