Espruino | The Espruino JavaScript interpreter - Official Repo
kandi X-RAY | Espruino Summary
kandi X-RAY | Espruino Summary
The Espruino JavaScript interpreter - Official Repo
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Espruino
Espruino Key Features
Espruino Examples and Code Snippets
Community Discussions
Trending Discussions on Espruino
QUESTION
I cannot make post request (get works fine) with espruino. I've already checked the documentation and it seems pretty equal here is my code:
...ANSWER
Answered 2019-Sep-21 at 17:59you're using a package called "http" and then trying to send a request over https. You should also log out 'data' in the res.close so you can get some errors to work with.
QUESTION
This seems like a really simple question and have searched for an answer, but all the answers are about dynamically loading a remote url.
I have a need to bundle libraries that are published as raw (non-NPM) source in Github. I would like webpack to download and include these files in my bundle. Caching the file locally for a period of time would be a bonus.
For example, I would like to be able to write:
...ANSWER
Answered 2018-Feb-23 at 23:14The webpack-require-http
plugin should meet your needs.
Or try scriptjs
:
QUESTION
I have making a cool project. I have more or less finalized my code, which will go on a NodeMCU running Espruino. I have trouble to save this code on the Espruino. This code should do this on each boot: connect to wifi, declare all functions and variables. Then the read()
function should be run continuously.
As I see from https://www.espruino.com/Saving I have two options. I tried both.
- If I put
save()
at the end of the code, after I restart NodeMCU code continues to run from where it stopped, but this mean that NodeMCU is not connected to wifi. - If I put
E.setBootCode(init());
at the end of code and restart the NodeMCU code doesn't run anymore.
Does anybody know how to properly save code on Espruino so it connects to wifi and defines functions and variables each time it is powered on?
My code:
...ANSWER
Answered 2017-Dec-18 at 09:28Your best solution is to rename your init
function to onInit
, and then type save()
after upload and it'll magically start working.
The page you found https://www.espruino.com/Saving mentions about onInit
automatically getting called at boot.
What you're doing with E.setBootCode(init());
won't work, because it's executing a string. What you're doing is executing the init()
function and then putting the return value of that function into setBootCode .
You'd need E.setBootCode("init();");
- but in this case you should really just do the first option - using onInit
QUESTION
I am trying to turn on a specific LED using the NeoPixel module. How it works is really easy: Parse it a 2D array of RGB colors. Here's an example:
...ANSWER
Answered 2017-Dec-04 at 09:00Yes, totally - it's worth looking at the neopixel docs at http://www.espruino.com/WS2811 as they suggest you use an array to store the current state.
Once you have that array - called arr
here - you can use the .set
method to set the 3 elements at the right position (3x the number, because RGB), and then can resend the whole array.
QUESTION
I starts learning IOT and watching introduction videos. I see there are two famous devices for IOT are, Espruino and Raspberry Pi.
I installed Espruino as web IDE, but during publish it is asking me plug in. Some videos recommends me to buy Raspberry Pi device also.
Question is, Do I have to buy device, or we have some tool available, which I can use for learning purpose?
Thanks.
...ANSWER
Answered 2017-Nov-24 at 08:38If you have Windows with 'Ubuntu on Windows' (or are running Linux) then you can create your own build of Espruino from http://github.com/espruino/Espruino, which you can run on your PC (and communicate with from the IDE via Telnet). All the internet functionality will work, however obviously you won't be able to access anything in the real world.
You can buy official Espruino boards pretty cheaply ($25), or you can run the Espruino software on an ESP8266 (which costs around $5 for a USB connected board) - it'll just be a little less plug and play, and isn't officially supported by the creators.
Raspberry Pis are also very cheap ($10 for the Zero W with internet connectivity), but you'll have to factor in the cost of an SD card too.
If you really don't want a physical device, you can actually rent Raspberry Pis (eg. https://raspberry-hosting.com/en) or as Sudheesh mentioned in response to your post there are emulators as well.
However given the time you're likely to spend learning to use IoT devices, spending a few dollars buying hardware to use would be a very good investment.
QUESTION
I had been working with Espruino for a bit and it is really a wonderful project. But, I am facing an issue for saving the code onto the flash, so that it can still be run when power is supplied to the board(NodeMCU), instead of the PC COM port. The code works completely fine until it is passed from the terminal. But, if I switch over the power supply it stops working. Also, I tried the save() and E.on('init',function(){}) but to no avail. It still doesn't create a web server. If someone could help out here it could be great! Thanks!
...ANSWER
Answered 2017-Jul-04 at 19:15After fiddling around with the documentation and crawling the scrambled web for almost a whole day I found out a solution myself. The issue ->
QUESTION
I recently got myself an esp8266-12e module and loaded the ESPRUINO.js firmware on it. I am trying execute a post request from the device, but the device always returns a 'no connection' error when trying to POST.
To troubleshoot I have ran a GET request to the same URL, and the request was successful, this means that internet is working on the device and communication with the intended server is possible.
I then moved on to see if there were errors in my HTTP POST code, I ran the same code in a node.js app and it successfully posted to the server.
Here is the code below, I removed the exact address of my server and my wifi/pass info.
...ANSWER
Answered 2017-Jun-26 at 15:48Turns out the http post request requires the 'content-length'
header to function correctly.
Here is the working post request model for anyone who may need it. Note: Payload has already been formatted as a JSON object.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Espruino
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page