MickMake / Project-LoRaSMS

A simple project using an ESP32 and LoRa module. Send an SMS over 20kms without a mobile network.
83 stars 26 forks source link

How to transplant it to the esp8266 development board? #1

Closed Droid-MAX closed 3 years ago

Droid-MAX commented 6 years ago

Arduino:1.8.5 (Windows 10), 开发板:"NodeMCU 0.9 (ESP-12 Module), 80 MHz, 115200, 4M (3M SPIFFS)"

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\LoRaSMS-D2D.ino: In function 'void setup()':

LoRaSMS-D2D:124: error: 'PRINTLN' was not declared in this scope

PRINTLN("MickMake LoRa SMS");

                         ^

LoRaSMS-D2D:145: error: 'PRINT' was not declared in this scope

PRINT("Set Freq to: "); PRINTLN(RF95_FREQ);

                   ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\LoRaSMS-D2D.ino: In function 'void loop()':

LoRaSMS-D2D:177: error: 'PRINT' was not declared in this scope

PRINT("RxE:"); PRINT(RXbuffer.numElements());

           ^

LoRaSMS-D2D:178: error: 'PRINTLN' was not declared in this scope

PRINT(" TxE:"); PRINTLN(TXbuffer.numElements());

                                             ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\LoRaSMS-D2D.ino: In function 'uint8_t addTx(uint8_t*, uint8_t)':

LoRaSMS-D2D:209: error: 'PRINT' was not declared in this scope

PRINT("Size:"); PRINTLN((uint8_t)TXmsg.Size);

           ^

LoRaSMS-D2D:209: error: 'PRINTLN' was not declared in this scope

PRINT("Size:"); PRINTLN((uint8_t)TXmsg.Size);

                                         ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\LoRaSMS-D2D.ino: In function 'void sendACK(uint8_t)':

LoRaSMS-D2D:264: error: 'PRINT' was not declared in this scope

PRINT("ACK "); printPacket(RXmsg);

          ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\LoRaSMS-D2D.ino: In function 'bool sendPacket(uint8_t, uint16_t)':

LoRaSMS-D2D:330: error: 'PRINT' was not declared in this scope

PRINT("Tx "); printPacket(TXmsg);

         ^

LoRaSMS-D2D:341: error: 'PRINTLN' was not declared in this scope

PRINTLN("Timeout on ACK!");

                        ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\LoRaSMS-D2D.ino: In function 'bool checkACK(uint8_t, uint8_t)':

LoRaSMS-D2D:372: error: 'PRINT' was not declared in this scope

 PRINT("ACK: OK ");

                 ^

LoRaSMS-D2D:373: error: 'PRINTLN' was not declared in this scope

 PRINTLN(RXbuffer.numElements());

                               ^

LoRaSMS-D2D:379: error: 'PRINTLN' was not declared in this scope

PRINTLN("ACK: NOK1");

                   ^

LoRaSMS-D2D:381: error: 'PRINTLN' was not declared in this scope

PRINTLN("ACK: NOK2");

                  ^

LoRaSMS-D2D:386: error: 'PRINT' was not declared in this scope

PRINT("ACK: NOK3 ");

                ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\LoRaSMS-D2D.ino: In function 'void printPacket(smsEntry*)':

LoRaSMS-D2D:418: error: 'PRINT' was not declared in this scope

PRINT(" t:");

         ^

LoRaSMS-D2D:437: error: 'PRINTLN' was not declared in this scope

PRINTLN("");

        ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\LoRaSMS-D2D.ino: In function 'uint16_t CRC(uint8_t*, uint8_t)':

LoRaSMS-D2D:467: error: 'CRC16' was not declared in this scope

CRC16 crc;

^

LoRaSMS-D2D:467: error: expected ';' before 'crc'

CRC16 crc;

    ^

LoRaSMS-D2D:471: error: 'crc' was not declared in this scope

crc.processBuffer((char *)CRCcheck, Size);

^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\htmlServer.ino: In function 'void handleRoot()':

htmlServer:71: error: 'PRINT' was not declared in this scope

PRINT("NM:"); PRINTLN(numMessages());

         ^

htmlServer:71: error: 'PRINTLN' was not declared in this scope

PRINT("NM:"); PRINTLN(numMessages());

                                 ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\htmlServer.ino: In function 'void setup_wifi()':

htmlServer:147: error: 'PRINT' was not declared in this scope

 PRINT("AP IP address: ");

                        ^

htmlServer:148: error: 'PRINTLN' was not declared in this scope

 PRINTLN(myIP);

             ^

htmlServer:149: error: 'class ESP8266WiFiClass' has no member named 'softAPsetHostname'

 WiFi.softAPsetHostname(ssid);

      ^

htmlServer:150: error: 'class ESP8266WiFiClass' has no member named 'setHostname'

 WiFi.setHostname(ssid);

      ^

E:\Users\44404\Workspace\esp8266\LoRaSMS\LoRaSMS-D2D\htmlServer.ino: In lambda function:

htmlServer:158: error: 'PRINTLN' is not captured

server.on("/style.css", []() {PRINTLN("# GET /style.css"); server.sendHeader("Cache-Control","max-age=2592000, public"); server.send(200, "text/css", strCSS);});

                              ^

exit status 1 'PRINTLN' was not declared in this scope

在文件 -> 首选项开启 “编译过程中显示详细输出”选项 这份报告会包含更多信息。

MickMake commented 6 years ago

Ah. OK. The PRINT and PRINTLN and my debugging printlns. The debug.h file contains these defines and you should be reading them in. Possibly you have another debug.h that's being called instead of mine? One very simple way of checking if you're picking up the right one: Go to my debug.h file in your Arduino IDE and type random characters in, (IE non-C rubbish). When you re-compile, if it throws an error, then you know you're picking up the right one. If not, then you're picking up a debug.h from elsewhere.

C0DYM commented 6 years ago

Is this your debug.h?

// #define DEBUG

ifdef DEBUG

define PRINTLN(fmt, ...)

define PRINT(fmt, ...)

else

define PRINTLN(fmt, ...) Serial.println(fmt, ##__VA_ARGS__)

define PRINT(fmt, ...) Serial.print(fmt, ##__VA_ARGS__)

endif

The debug.h was the file provided in your github repo. Can you please help me out? Also, what crc16.h did you use?

Fuellhase commented 6 years ago

I have the same questions. Could you pls answer? Where do I find atomic.h? THX

Fuellhase commented 6 years ago

Now I'm still searching for the suitable CRC16.h. Can You please help me, where to download? THX.

Fuellhase commented 6 years ago

Compiler error concerning crcr disappeared afterr installing FastCRC-Library.

Now the following compiler errors appear: /Volumes/Macintosh HD/Users/Peter/Dropbox/Arduino/libraries/RadioHead/RHHardwareSPI.cpp:49:9: error: 'class SPIClass' has no member named 'attachInterrupt' SPI.attachInterrupt(); ^ ../Arduino/libraries/RadioHead/RHHardwareSPI.cpp: In member function 'virtual void RHHardwareSPI::detachInterrupt()': ../Arduino/libraries/RadioHead/RHHardwareSPI.cpp:56:9: error: 'class SPIClass' has no member named 'detachInterrupt' SPI.detachInterrupt(); ^ I have no idea how to solve this. I try to compile for HELTEC WIFI LORA w. OLED board but also for FireBeetle-ESP32 I get the same error messages

langtupt commented 6 years ago

not working with esp32 @@

alexsherba29 commented 5 years ago

have that same error: Error compiling for board Heltec_WIFI_LoRa_32.

hosek commented 5 years ago

@Fuellhase it's this library

MickMake commented 5 years ago

The original came from here All the links are on my website article. But, yup. I should revisit this project for the ESP8266!

alekexe commented 4 years ago

The original came from here All the links are on my website article. But, yup. I should revisit this project for the ESP8266!

Please do. This project has a lot of potentials.