El vídeo parece cortado, solo logro ver al 3:28 da la sensación de que falta mucho más.
Conceptos Básicos
Qué aprenderás sobre Internet of Things
Espectro electromagnético y qué es radiofrecuencia
Clasificacion de radiofrecuencia
Regulación de la radiofrecuencia
¿Qué son las Telecomunicaciones?
Halfduplex y Fullduplex
Clasificación de transmisiones: Upstream y Downstream
Link budget
Con ciertas características, ¿Habría conexión en el sistema?
Alto data rate
Wi-fi
Bluetooth
Redes celulares
LPWANs
NB-IoT
Consideraciones para implementación de NB-IoT
LoRaWAN
Reto 2
¿Qué usarías para monitorear la posición GPS de un vehículo? y ¿Qué usarías para monitorear datos en campo?
Diseño
Arquitectura de nodos
Introducción a la práctica
Instalación de framework ESP32 e instalación de framework SAMD21
Qué es una interrupción
Práctica de WiFi
Prueba de señal Wi-fi
Protocolo HTTP desde un microcontrolador
Conectando sensores y actuadores al microcontrolador
Preparación de aplicación para recibir datos
Programación por eventos de un microcontrolador
Configuración de eventos del microcontrolador
Conexión de aplicación
Práctica con LoRa
¿Cuál es el stack de LoRaWAN?
Creando tu propio gateway
Ensamblado de gateway
Pon a andar tu gateway de LoRa
Creando tu Stack de LoRa
Conecta tu nodo a internet
Integrando datos a un dashboard
Terminando de implementar nuestro stack de LoRa
BugFixing nuestro stack de LoRa
Ensamblando el nodo de LoRa
Probando LoRa en nuestro Dashboard
Prácticas con tarjetas MKR
Cierre del curso
Cierre del curso
You don't have access to this class
Keep learning! Join and start boosting your career
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.
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:
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.
To ensure a secure connection, disconnect the USB cable before handling the ESP32 from the CTO protocol:
Once the hardware is set up, programming and testing the transmission is simple:
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
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());
}
Me sirve esta tarjeta para hacer la pràctica:
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…
Want to see more contributions, questions and answers from the community?