Conceptos Básicos

1

Qué aprenderás sobre Internet of Things

2

Espectro electromagnético y qué es radiofrecuencia

3

Clasificacion de radiofrecuencia

4

Regulación de la radiofrecuencia

5

¿Qué son las Telecomunicaciones?

6

Halfduplex y Fullduplex

7

Clasificación de transmisiones: Upstream y Downstream

8

Link budget

9

Con ciertas características, ¿Habría conexión en el sistema?

Alto data rate

10

Wi-fi

11

Bluetooth

12

Redes celulares

LPWANs

13

NB-IoT

14

Consideraciones para implementación de NB-IoT

15

LoRaWAN

Reto 2

16

¿Qué usarías para monitorear la posición GPS de un vehículo? y ¿Qué usarías para monitorear datos en campo?

Diseño

17

Arquitectura de nodos

Introducción a la práctica

18

Instalación de framework ESP32 e instalación de framework SAMD21

19

Qué es una interrupción

Práctica de WiFi

20

Prueba de señal Wi-fi

21

Protocolo HTTP desde un microcontrolador

22

Conectando sensores y actuadores al microcontrolador

23

Preparación de aplicación para recibir datos

24

Programación por eventos de un microcontrolador

25

Configuración de eventos del microcontrolador

26

Conexión de aplicación

Práctica con LoRa

27

¿Cuál es el stack de LoRaWAN?

28

Creando tu propio gateway

29

Ensamblado de gateway

30

Pon a andar tu gateway de LoRa

31

Creando tu Stack de LoRa

32

Conecta tu nodo a internet

33

Integrando datos a un dashboard

34

Terminando de implementar nuestro stack de LoRa

35

BugFixing nuestro stack de LoRa

36

Ensamblando el nodo de LoRa

37

Probando LoRa en nuestro Dashboard

38

Prácticas con tarjetas MKR

Cierre del curso

39

Cierre del curso

You don't have access to this class

Keep learning! Join and start boosting your career

Aprovecha el precio especial y haz tu profesión a prueba de IA

Antes: $249

Currency
$209
Suscríbete

Termina en:

1 Días
17 Hrs
52 Min
48 Seg

Ensamblando el nodo de LoRa

36/39
Resources

How to assemble the hardware needed for LoRaWAN?

Once your program is compiled and ready to be uploaded to your ESP32 board, it is crucial that you assemble the components you will need for data transmission. By following a series of steps, you will be able to effectively assemble your hardware to ensure proper operation.

What components to use in the assembly?

In this project, we will use an assembly similar to the one used in past practices with Wi-Fi, but with some important exceptions:

  • LED and Button: We will eliminate the LED and button because if they are not declared as compulsive input inputs, they could damage the microcontroller by connecting them directly to ground with a positive signal. If you decide to use an LED, place it on the pin of your choice and define it in the program instead of the Vim Vim LED.

  • Additional connections:

    • Hachette LED pin: This must be connected to voltage, ground, and pin 23.
    • Data pin: This has already been defined in the LoRaWAN program.

How to connect the antenna for transmission?

It is essential to differentiate between the Wi-Fi antenna and the LoRaWAN antenna, as they have different purposes and connections:

  • LoRaWAN antenna: It uses a connector called U.FL. This type of connector is common in the industry and allows connecting from the PCB to an SMA adapter. This adapter can be installed in a housing (kees) to have a direct SMA output.

  • Antennas used: You can use dipole antennas from the Arduino LoRaWAN kit that operate on the correct frequencies (such as 915 MHz). If the frequency does not match 915 MHz, the transmit power and gain may decrease.

How to properly connect the antenna?

To ensure a secure connection, disconnect the USB cable before handling the ESP32 from the CTO protocol:

  1. Connecting the U.FL connector: Insert the U.FL connector into the correct connector carefully, avoiding deformation.
  2. SMA adapter connection: Then connect the SMA adapter and put the ESP32 back in place respecting the voltage and ground pins.
  3. Antenna verification: Make sure that the SMA antenna is compatible and operates on the correct frequency (915 MHz).

How to program and verify data transmission?

Once the hardware is set up, programming and testing the transmission is simple:

  1. Connection and programming: Connect your device to the computer and select the corresponding serial port to upload the previously compiled program.
  2. Traffic monitoring: Open the serial monitor to observe the behavior of the system. Initially, startup processes and any relevant events recorded in the LMIC library should be reported.

Finally, connect to your Kedy network and open The Things Network (TTN) console portal to verify that data is being received correctly at your console. This practice is critical to ensure that the system is working properly and you can transmit data using LoRaWAN. Continue to hone your skills and expand your knowledge in the fascinating world of IoT!

Contributions 5

Questions 2

Sort by:

Want to see more contributions, questions and answers from the community?

El vídeo parece cortado, solo logro ver al 3:28 da la sensación de que falta mucho más.

codigo corregido

// Ejemplo de nodo LoRa
#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <DHT.h>
#include <CayenneLPP.h>


#define DHTPIN 23
#define DHTYPE DHT22

DHT dht(DHTPIN, DHTYPE);
CayenneLPP lpp(51);

uint8_t NWSK [16]={};
uint8_t APPSKEY [16]={};
uint32_t DEVADDR = 0x26021460;

void os_getArtEui(u1_t *buf) {}
void os_getDevEui(u1_t *buf) {}
void os_getDevKey(u1_t *buf) {}

unsigned long previusMillis=0;
const unsigned TX_INTERVAL = 10;

const lmic_pinmap lmic_pins = {
    .nss = 18,
    .rxtx = LMIC_UNUSED_PIN,
    .rst = 14,
    .dio = {26, 33, 32}};

void
onEvent(ev_t ev)
{
  switch (ev)
  {
  case EV_TXCOMPLETE:
  Serial.println("[LMIC] Radio TX complete");
  digitalWrite(LED_BUILTIN,LOW);

    break;
  default:
    Serial.println("Evento desconocido");
    break;
  }
}

//Funciones
void enviar_datos(uint8_t *mydata, uint16_t len)
{
  if (LMIC.opmode & OP_TXRXPEND)
  {
    Serial.println("[LMIC] OP_TXRXPEND, not sending");
  }
  else
  {
    LMIC_setTxData2(1, mydata, len, 0);
  }
}

void getInfoAndSend()
{
  digitalWrite(LED_BUILTIN,HIGH);
  float temp = dht.readTemperature();
  lpp.addTemperature(1,temp);
  enviar_datos(lpp.getBuffer(),lpp.getSize());
}


void setup()
{
  Serial.begin(115200);
  Serial.println("[INFO] Iniciando");
  pinMode(LED_BUILTIN,OUTPUT);
  dht.begin();
  os_init();
  LMIC_reset();
  LMIC_setSession(0x1,DEVADDR,NWSK,APPSKEY);

  for(int chan=0;chan<72;++chan){
LMIC_disableChannel(chan);

  }

  LMIC_enableChannel(10);
  LMIC_setLinkCheckMode(0);
  LMIC_setDrTxpow(DR_SF7,20);
  previusMillis = millis();

}

void loop()
{
  if(millis()>previusMillis+(TX_INTERVAL*1000)){
    getInfoAndSend();
    previusMillis=millis();
  }
  os_runloop_once();

}


hola les comparto mi codigo!!

#include <lmic.h>
#include <hal/hal.h>
#include <SPI.h>
#include <CayenneLPP.h>

#define ESP32_LED_BUILTIN 2
#define LPPBUFFSIZE 32
#define TX_INTERVAL 10

// From TTN
uint32_t DEVADDR = 0x26031696;
uint8_t NWSK[16] = { 0x77, 0x6B, 0x1F, 0xC4, 0x03, 0xBF, 0x42, 0xC3, 0x56, 0xA3, 0x8F, 0x36, 0x10, 0x34, 0xF2, 0x53 };
uint8_t APPSK[16] = { 0x4B, 0xD2, 0x28, 0xEB, 0xE4, 0xD9, 0x90, 0x75, 0x65, 0x10, 0x43, 0xA7, 0xD3, 0x43, 0x1A, 0x56 };
unsigned long previousMillis = 0;

const lmic_pinmap lmic_pins = {
.nss = 18,
.rxtx = LMIC_UNUSED_PIN,
.rst = 14,
.dio = {26,33,32}
};

CayenneLPP lpp(LPPBUFFSIZE);

void os_getArtEui(u1_t* buff){};
void os_getDevEui(u1_t* buff){};
void os_getDevKey(u1_t* buff){};

void onEvent(ev_t ev)
{
switch (ev)
{
case EV_TXCOMPLETE :
Serial.println(“LMIC : Event Tx complete”);
digitalWrite(ESP32_LED_BUILTIN,LOW);
break;

default:
  Serial.println("UKN Event");
  break;

}
}

void setup() {
Serial.begin(115200);
pinMode(ESP32_LED_BUILTIN,OUTPUT);
os_init();
LMIC_reset();
LMIC_setSession(0x1,DEVADDR,NWSK,APPSK);
for (uint8_t chan=0;chan<=72;++chan)
{
//904.3 MHz banda de 915 MHz 902MHz-928MHz
LMIC_disableChannel(chan);
}

LMIC_enableChannel(10);
LMIC_setLinkCheckMode(0);
LMIC_setDrTxpow(DR_SF7,20);
previousMillis = millis();

}

void loop() {
if (millis() > (previousMillis + TX_INTERVAL*1000))
{
getInfoAndSend();
previousMillis = millis();
}
os_runloop_once();
}

void sendData(uint8_t *myData, uint16_t dataLen)
{
if(LMIC.opmode & OP_TXRXPEND)
{
Serial.println("[LMIC] OP_TXRXPEND, not sending ");
}
else
{
LMIC_setTxData2(1,myData,dataLen,0);
}
}

void getInfoAndSend()
{
digitalWrite(ESP32_LED_BUILTIN,HIGH);
int ADC_VALUE = analogRead(A0);
float pot = (ADC_VALUE * 3.3 ) / (4095);
lpp.addVoltage(1,pot);
sendData(lpp.getBuffer(),lpp.getSize());
}

Hola Eduardo, Cordial Saludo… Te comento que estoy usando una tarjeta LoRa32u4-II y pude subir tu codigo tal cual (haciendo unos ajustes como corresponde como lo son los pines físicos), también pude realizar los pasos en TTN sin embargo estoy intentando conectarme a un GATEWAY dragino OLG02 (el cual es que tengo a la mano) el cual esta registrado en TTN… ¿hay algún paso que estoy omitiendo para lograr conexión? pues no estoy usando la TTGO… quedo atenta…