LG01-N and Heltec ESP32 V2

298 views
Skip to first unread message

david ragot

unread,
Apr 20, 2021, 10:58:24 AM4/20/21
to Dragino-user
Hello,

I have a dragino LG01-N and a heltec esp32 v2 : https://heltec.org/project/wifi-lora-32/

Here is the configuration for the end node heltec esp32 for the lora :
/*
  This is a simple example show the Heltec.LoRa sended data in OLED.

  The onboard OLED display is SSD1306 driver and I2C interface. In order to make the
  OLED correctly operation, you should output a high-low-high(1-0-1) signal by soft-
  ware to OLED's reset pin, the low-level signal at least 5ms.

  OLED pins to ESP32 GPIOs via this connecthin:
  OLED_SDA -- GPIO4
  OLED_SCL -- GPIO15
  OLED_RST -- GPIO16
  
  by Aaron.Lee from HelTec AutoMation, ChengDu, China

  
  this project also release in GitHub:
*/

#include "heltec.h"
#include "images.h"

#define BAND    868E6  //you can set band here directly,e.g. 868E6,915E6
#define txPower 14
#define frequency 868E6
#define spreadingFactor 7
#define signalBandwidth 125E3
#define codingRateDenominator 5
#define preambleLength 8
#define syncWord 0x34

unsigned int counter = 0;
String rssi = "RSSI --";
String packSize = "--";
String packet ;

void logo()
{
  Heltec.display->clear();
  Heltec.display->drawXbm(0,5,logo_width,logo_height,logo_bits);
  Heltec.display->display();
}

void setup()
{
   //WIFI Kit series V1 not support Vext control
  Heltec.begin(true /*DisplayEnable Enable*/, true /*Heltec.Heltec.Heltec.LoRa Disable*/, true /*Serial Enable*/, true /*PABOOST Enable*/, BAND /*long BAND*/);
 
  Heltec.display->init();
  Heltec.display->flipScreenVertically();  
  Heltec.display->setFont(ArialMT_Plain_10);
  logo();
  delay(1500);
  Heltec.display->clear();
  
  Heltec.display->drawString(0, 0, "Heltec.LoRa Initial success!");
  Heltec.display->display();
  delay(1000);


  LoRa.setFrequency(frequency);
  LoRa.setSpreadingFactor(spreadingFactor);
  LoRa.setSignalBandwidth(signalBandwidth);
  LoRa.setCodingRate4(codingRateDenominator);
  LoRa.setPreambleLength(preambleLength);
  LoRa.setSyncWord(syncWord);

  delay(1000);
}

void loop()
{
  Heltec.display->clear();
  Heltec.display->setTextAlignment(TEXT_ALIGN_LEFT);
  Heltec.display->setFont(ArialMT_Plain_10);
  
  Heltec.display->drawString(0, 0, "Sending packet: ");
  Heltec.display->drawString(90, 0, String(counter));
  Heltec.display->display();

  // send packet
  LoRa.beginPacket();
  

  LoRa.setTxPower(14,RF_PACONFIG_PASELECT_PABOOST);
  LoRa.print("hello ");
  LoRa.print(counter);
  LoRa.endPacket();

  counter++;
  digitalWrite(LED, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
}

And here is the configuration for the dragino LG01-N (last firmware April 21):
2021-04-20 16_45_11-Window.png
The dragino is configured into custom method.


I have several problem :
1/ the logread -f command return nothing from lora :
2021-04-20 16_48_17-Window.png

2/ If I go to /var/channels
there is nothing :
2021-04-20 16_51_18-Window.png

whereas if I consult the documentation, it could be 2 files like on this picture in the documentation : 
2021-04-20 16_56_10-LG01N_LoRa_Gateway_User_Manual_v1.4.0.pdf.png

So What is the problem? Why I don"t have the files in /var/iot/channels?
(note : var is a symlink to tmp)

Thank you very much for your help.

David


Edwin

unread,
Apr 20, 2021, 11:07:57 AM4/20/21
to david ragot, Dragino-user
Hi, David. 

First you need to see the packet arrive the gateway. 
1) What is the output from Heltec?
2) Did heltec sending packets?  
 
 
Best Regards
Edwin Chen


From:david ragot <david...@gmail.com>
Date:2021-04-20 22:58
Subject:LG01-N and Heltec ESP32 V2
To:dragino-user <dragin...@googlegroups.com>
--
You received this message because you are subscribed to the Google Groups "Dragino-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dragino-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dragino-user/07adc26a-6d59-4742-8cfe-5b97dcf548a1n%40googlegroups.com.


2021-04-20 16_45_11-Window.png
2021-04-20 16_48_17-Window.png
2021-04-20 16_51_18-Window.png
2021-04-20 16_56_10-LG01N_LoRa_Gateway_User_Manual_v1.4.0.pdf.png

david ragot

unread,
Apr 20, 2021, 12:54:18 PM4/20/21
to Dragino-user
Thank you for your response.

I do a diff between helted IDE Arduino library and github heltec library. So there some differences.
I have changed the heltec 's library. Instead of using the default library downloaded by the Arduino IDE, I use the Heltec 's github library.

And now ..... tata !
2021-04-20 18_44_27-10.130.1.1 - PuTTY.png
it 's ok. I 'm receiving packets. (hello 1 hello 2 etc...)

But I have always nothing here : /var/iot/channels/ :

2021-04-20 18_51_52-Window.png

How can I retrieve the data in sysfs of the dragino?

Thank you
David

Edwin

unread,
Apr 20, 2021, 9:39:51 PM4/20/21
to david ragot, Dragino-user
 You must send in a match data format so the lg01_pkt_fwd will be to process the data and put them in /var/iot/channels. Please check carfully in the manual. 
 
 
Best Regards
Edwin Chen


From:david ragot <david...@gmail.com>
Date:2021-04-21 00:54
Subject:Re: LG01-N and Heltec ESP32 V2
To:dragino-user <dragin...@googlegroups.com>
To view this discussion on the web visit https://groups.google.com/d/msgid/dragino-user/e70a0d7c-9b50-4ff8-a68a-a94ae76846a0n%40googlegroups.com.


2021-04-20 18_44_27-10.130.1.1 - PuTTY.png
2021-04-20 18_51_52-Window.png

david ragot

unread,
Apr 21, 2021, 3:28:52 AM4/21/21
to Dragino-user
Hello Chen,

It's ok, I add this line for the packet sending for the Heltec :
  LoRa.beginPacket();
  LoRa.setTxPower(14,RF_PACONFIG_PASELECT_PABOOST);
  LoRa.beginPacket();
  LoRa.print("<");
  LoRa.print(device_id);
  LoRa.print(">temperature:=");
  LoRa.print(tem);
  LoRa.print("&humidity=");
  LoRa.print(hum); 
  LoRa.endPacket();
  delay(10000);

And I got this : 
2021-04-21 09_27_21-Window.png

The custom  script save well the data into the file "toto"

That's good !!

Thank you for your help.

David
Reply all
Reply to author
Forward
0 new messages