Using MDOT with sensors and actuators

Home Forums mDot/xDot Using MDOT with sensors and actuators

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22394
    Antonio Yubaile
    Participant

    I am new using LoRaWAN technologies. I have send text uplinks and downlinks using AT Commands. But now I don’t know how to use a sensor and actuator with the mDot

    I am searching about low power consumption too. How can I sleep the mdot and wake up when I need to receive or transmitt?

    #22396
    Jason Reiss
    Keymaster

    To interact with sensors you will need to do some custom development with mbed.

    https://os.mbed.com/platforms/MTS-mDot-F411/

    #22800
    Antonio Yubaile
    Participant

    I have used the MBED Dot-examples and I can send uplinks and downlinks, but I want to turn on a LED when I receive a downlink. How is it possible? I have searched in libmdot and I have not found anything

    #22801
    Jason Reiss
    Keymaster

    See the mDot at firmware for an example of setting up custom event handlers.
    https://os.mbed.com/teams/MultiTech/code/Dot-AT-Firmware/?platform=MTS-mDot-F411

    Using the setEvents function a custom event handler can be provided to the dot library.

    CommandTerminal.h and CommandTerminal.cpp define a RadioEvent object inheriting the mDotEvent Class.

    Be sure to call the base class functionality to fill the packet _flags and _info objects of the mDotEvent.

    CommandTerminal.h

    
    class RadioEvent : public mDotEvent { ...

    CommandTerminal.cpp

    
    void CommandTerminal::init() {
        _dot->setEvents(_events);
    }
    
    void CommandTerminal::RadioEvent::PacketRx(uint8_t port, uint8_t *payload, uint16_t size, int16_t rssi, int8_t snr, lora::DownlinkControl ctrl, uint8_t slot, uint8_t retries) {
        mDotEvent::PacketRx(port, payload, size, rssi, snr, ctrl, retries);
     
        if (serial_data_mode) {
            logDebug("Rx %d bytes", size);
            if (size > 0) {
                CommandTerminal::Serial()->write((char*) RxPayload, RxPayloadSize);
            }
            if (!CommandTerminal::Serial()->readable() && _dot->getAckRequested() && _dot->getClass() == "C") {
                _sendAck = true;
            }
        }
    }
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.