Has anyone used PubNub API with Espruino Pico? Please let me know how to include the PubNub npm module or require the core JS file. Thanks in advance.
I followed http://forum.espruino.com/conversations/266254/#comment12223235 and
But it shows the error as 'You have more open brackets than close brackets. Please see the hints in the editor window'.
I think you need to use " instead of ', see http://www.espruino.com/Modules
I'm thinking of using MQTT from there because the PubNub seems to be 85KB minified size.
The type of quotes shouldn't make a difference - and yes, 85k would be way too much :)
The module you seem to be including is only 20k, but even so it seems like a lot. It also appears to use XMLHttpRequest, which is a browser API - so it seems unlikely it'd work. There is a REST API (https://www.pubnub.com/docs/pubnub-rest-api-documentation) so especially if you were just publishing it should be quite straightforward.
But if they have an MQTT option, I'd totally suggest using that. It's a lot more standard and the MQTT module is now pretty well tested.
Thanks for the quick reply. Sure, i'm going to use MQTT :)
I'm using MQTT module, so closing this
© Espruino, powered by microcosm.
Report a problem