Giter Site home page Giter Site logo

pylatex / im880b Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 2.0 509 KB

HCI Stack and Application for iM880B from IMST, based on their initial code.

C++ 5.85% C 90.38% Objective-C 2.13% Makefile 1.63%
lorawan lorawan-application imst wimod hci pic microcontroller uart

im880b's Introduction

iM880B

Multiplatform HCI stack Implementation, to command the IMST's WiMOD iM880B-L LoRaWAN module. Based initialy on the HCI LoRaWAN example code from IMST. Here we list the currently supported platforms and IDEs:

IDE Compiler Windows UX 8 bit PIC
Code::Blocks GCC/G++ Compiler X X
Microchip's MPLAB X IDE XC8 Compiler X

Status of Target Platforms

PC

For both platforms, an example code can be found in examples/main_pc.cpp. Every layer of the HCI stack proposed by IMST has their own buffers and source code (WiMOD_HCI_Layer.c, SLIP.c and SerialDevice_pc.c), so every layer can be debugged individually to understand the inner working concepts of the HCI stack.

  • Windows: In Rework.

  • Linux: Pending Work

    The whole source code compiles, but the code to access the Serial Port have to be reviewed (due to the fact that the original code was intended to work in Windows).

MCUs

Due to the fact that MCUs has limited resources, the whole HCI stack is programmed in a single and compact WMLW_API.c file.

  • Microchip PIC, 8 bit family: Working.

    Currently Supported Targets:

    However, the code can be easily ported to another PIC reference with at least a UART module with interrupts by Rx complete.

    The file examples/main_pic.c includes a basic setup (oscillator and EUSART) to use the internal oscillator at 8 MHz (Some tunning on register values have to be done to work with other crystal/oscillator configurations), intending to be a state machine in which a LED connected to RA0 blinks once the OTA authentication was successful and then blinks every time a data is being sent.

Main Functions and Usage

Depending on the purpose of the final application, if it's intended to send many sensor measures with a Cayenne-like protocol, you must #include the header library "pylatex.h" at top of your source code. But, if you want to directly send messages over LoRaWAN, as this library does, you have to #include the header library "WiMOD_LoRaWAN_API.h". For details of inner working, see the related source codes:

Header Source
pylatex.h pylatex.c
WiMOD_LoRaWAN_API.h WMLW_API.c (for MCU) or WiMOD_LoRaWAN_API.c (for PC)

pylatex.h notable functions:

void initLW (serialTransmitHandler transmitter)

Indicates to pylatex.h library the external transmitter function, that the library must use to send an array over a previously configured 115200, 8N1 UART port, connected to the iM88xx modem.

void pylatexRx (char RxByteUART)

Call this on every received byte, RxByteUART, from your serial port implementation.

bool AppendMeasure (char type,char *ptrMeasure)

For a specific type of measure (let's say, CO2 with PY_CO2 constant), receives a ptrMeasure pointer to an array of the spliced measure, depending on the weight of the measure, and appends it at the end of the message to be sent.

void SendMeasures (pyModeType confirmed)

Once appended all measures, SendMeasures() sends all measures to the iM88xx to be sent through LoRaWAN. The confirmed variable may be PY_CONFIRMED for confirmed messages or PY_UNCONFIRMED for unconfirmed messages. This function can be called safely, only after a first invocation of initLW() and the calling of the pylatexRx() on every incoming byte (See the main_pic8.c example).

Pending tasks

  • Integrate PIC targets with MCC
  • Add channel support (to identify every measure on a message with multiple measures of same type)

About Us

The main collaborators of this project, came from GITUD members, sponsored by the CIDC and the IoT Unit from Ashara Studios.

im880b's People

Contributors

alexfbp avatar cardozo94 avatar jefer10 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

im880b's Issues

Uso de serial por eventos (y no por polling)

Actualmente los codigos que dependen de SerialDevice.h funcionan leyendo continuamente el puerto serial, debería de depender de triggers asociados a funciones definidas por el usuario. Se presentan en los siguientes articulos:

Para Windows:

Para Linux:

Librería Sensor HPMA115S0

Actualmente se está desarrollando en la rama hpm, teniendo en cuenta el datasheet del HPM115S0

Actualmente se tienen funciones para enviar los comandos (hpmSend*()). Al enviarse cada comando, debería definirse una variable, puede ser un enum; para saber cual fue el último comando enviado hacia el sensor. De ser con este enum, se puede usar un switch(){} dentro de la función que procesa cada octeto por UART, hpmInput(char octetoRx), y es esta última funcion el nucleo de procesamiento de la trama a ser recibida por UART, que tenga en cuenta siempre si el autosend está activado o no.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.