I recently bought two MakerHawk RF Wireless 868 MHz LoRa modules, which are actually EByte E32 868T20D types. The E32 series is based on the SemTech SX1276/SX1278 RF IC from SEMTECH with transparent transmission and LoRa spread spectrum technology. EByte provides datasheets and product specs, but there is no library for Arduino or whatever. After searching the internet I finally came across Bob Chan’s github E32-TTL-100 repository at https://github.com/Bob0505/E32-TTL-100.
I didn’t test my new 868mhz LoRa module upon arrival, but immediately flashed the Arduino sketch on to my UNO and ran it with the E32 module connected (see also https://www.teachmemicro.com/e32-ttl-100-sx1278-lora-module/). I realized that the sketch was for a different module, but I anticipated that the differences were manageable.
Unfortunately, running the sketch effectiveley changed the factory settings (and power on defaults), and the result was that the modules couldn’t communicate with each other any more. I assume that the settings in the sketch are specific for the 433 mhz module and, although the sketch reported success, the two modules (configured to Device_A and Device_B) were configured with incompatible settings (probably SPED or CHAN). I modified Bob Chan’s sketch so I could reset my modules to factory defaults (C0 00 00 1A 06 44). After that, transparent transmission was possible again. So the sketch wasn’t totally useless, but obviously requires some adjustments.
If you want to reset your module to factory defaults, use Bob Chan’s sketch and replace its setup() method with the following:
void setup() { pinMode(M0_PIN, OUTPUT); pinMode(M1_PIN, OUTPUT); pinMode(AUX_PIN, INPUT); pinMode(LED_BUILTIN, OUTPUT); softSerial.begin(9600); Serial.begin(9600); byte buf[] = { 0xC0, 0x00, 0x00, 0x1A, 0x06, 0x44 }; SleepModeCmd(W_CFG_PWR_DWN_SAVE, (void* )buf); SleepModeCmd(W_RESET_MODULE, NULL); SleepModeCmd(R_CFG, (void* )buf); // Mode 0 | normal operation SwitchMode(MODE_0_NORMAL); //self-check initialization. WaitAUX_H(); delay(10); Serial.println("Finished!!"); }
Don’t forget to adjust the pin definitions at the beginning of the sketch to match your wiring. If you want to immediately check that your module is back online, you can also replace the loop() function with this:
void loop() { if (Serial.available() > 0) { //Read from serial monitor and send over OSOYOO UART LoRa wireless module String input = Serial.readString(); softSerial.println(input); } if (softSerial.available() > 1) { //Read from UART LoRa wireless module and send to serial monitor String input = softSerial.readString(); Serial.println(input); } delay(20); }
If you enter strings in the Arduino IDE serial monitor it will be send out to the other module. You can connect two Arduino’s to your computer, but this requires that you start a second instance of the IDE. Just opening an example or another sketch from a running IDE instance wouldn’t do the trick.
Check EByte’s download page at http://www.ebyte.com/en/data-download.aspx and open the UART section. There you’ll find an entry for your specific module’s documentation.
2 thoughts on - Ebyte E32 (868T20D) 868mhz wireless LoRa module factory reset
Wow! 2 days solid searching after sending a load of random stuff to this same module via micro-python and ESP32 UART rendered it totally messed up. Sure I could have just brought a new one for 11 pounds, however the time spent reading and testing registers and understanding of UART is priceless. I have to break for holidays now but will be straight on this after, thanks so much and I’ll thank the author of the original code also.
Much respect
Tony.
Excellent this worked. The only thing is the manual states the default data rate is 2.4K is the default, it’s not! at least in the ones I purchased, I ascertained this by listening to the output on my SDR and changing it accordingly using the supplied code. So if things still don’t work out try using { 0xC0, 0x00, 0x00, 0x18, 0x06, 0x44 } replacing byte 4 0x1A (2.4k data rate) with 0x18 (0.3K 300 data rate) I purchased another module and this is what it is set to.
Again, thank you so much and happy new year.