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 :)
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem