Copyright © https://mongoose-os.com

Mongoose OS Forum

frame
ATTENTION! This forum has moved to:

https://community.mongoose-os.com

Do not post any new messages.

CoAP option in smart.js

we are using smart.js for building simulation & test clients for  gateway device (Edition/Raspberry Pi) app development. SmartJS has inbuilt http API support, we could build REST API end for testing. no issues.

Wondering if the same can be done for CoAP and LWM2M protocol both are using UDP, (DTLS is not required). I learn that CoAP supported on mongoose, but do you have if any option to write UDP send/receive with smart.js? Also looking for TCP server (socket) programming support in JavaScript to help us to deploy minimal test Modbus Server for interoperablity.

Thanks.

Comments

  • What I am looking at is minimal udp sample program like below code sample taken from https://github.com/nodemcu/nodemcu-firmware firmware.  I could not see direct TCP/UDP code sample for smartjs client.

    UDP client and server

    -- a udp server
    s=net.createServer(net.UDP)
    s:on("receive", function(s, c) print(c) end)
    s:listen(5683)
    
    -- a udp client
    cu=net.createConnection(net.UDP)
    cu:on("receive", function(cu, c) print(c) end)
    cu:connect(5683, "192.168.18.101")
    cu:send("hello")



  • SergeySergey Dublin, Ireland
    We're working on a plain UDP support.
    CoAP binding is not yet done.

    Could you elaborate on your CoAP use case please - what project are you working on?
Sign In or Register to comment.