Espruino on the Pi (with WiringPi) #133
Replies: 31 comments
-
Posted at 2014-12-19 by @allObjects ...no deserters please ;-) ... I know that power consumption - more precisely: power frugality - cannot be beaten by any other platform. But obviously speed helps the JavaScript part of Espruino a lot. Are there options available for a less power frugal but much faster chip on Espruino regular and pico board? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-12-19 by @gfwilliams I don't think there is anything that would fit in the same form factor. Having said that you can overclock the chips. The f103 in the original board isn't great as afaik if you want USB then 72mhz is mandatory. However the f401 allows different clocks while keeping USB running. If the process tech and core is the same as the F407 then it might be possible to double the clock speed to 168mhz |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-12-22 by mindrobots Espruino everywhere!! I just purchased one of these ARMinARM boards for one of my Raspberry Pis -> https://www.tindie.com/products/onandoffables/arminarm/ It's really a nicely done board that turns your RasPi into an ARM development platform.One of the exciting things is there is an Espruino ready to run on it. With wiringPi and Espruino on the Pi and now this board running Espruino, I can easily run Espruino everywhere (obviously part of your plans for world domination!) Well done!! Rick |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-08 by bob_dvb You mention the software SPI, but what about the hardware SPI and I2C? Bob |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-08 by russdx Think I will be using this option for my little project :D |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-09 by @gfwilliams @bob_dvb the software SPI and I2C isn't implemented yet, but it should be very easy to do using the WiringPi library. It's just a matter of 'filling in the blanks' in |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-10 by russdx Is there a guide any where on how to set up and run projects on the raspberry pi? Thanks |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-12 by @gfwilliams Have you managed to build the binary? If so, there's Basically you can get a command-line just with |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-28 by user52580 Is there a way to exit from Espruino back to Raspbian? I know I can type reset() but that command only resets Espruino environment but I stay in Espruino command prompt. I want to exit to Linux, how to do that? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-28 by @gfwilliams Just type |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-29 by user52580 quit() works, CTRL+C doesn't (and I think it is good!). I found I can kill espruino process from other terminal but quit() command is better way. Thank you! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-01-29 by @gfwilliams Where did you get the binary from? the zip file? If so, try getting the latest version - I released 1v72 yesterday, and that would have had the Ctrl+C, plus a few other improvements. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-06 by user52580 CTRL-C doesn't work in 1v73 but as I said , it is not problem for me. Maybe that CTRL+D should be used (UNIX, hangup). I connect to Rasberry over ssh, maybe that CTRL-C is not transferred... I noticed something strange with 1v73 (git). I enter ".help" and after that quit() and I see some error report or what is that:
|
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-06 by @gfwilliams Thanks for the report - I've just made a bug for this. The Linux versions of Espruino check for memory leaks on exit, and it looks like that particular syntax error caused a memory leak. It's not much to worry about though - you'll lose a few bytes of memory each syntax error until this is fixed - but then you have several hundred MB to play with :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-06 by @gfwilliams Actually just an update on this - it's not a problem with the interpreter at all. It's just that on exit Espruino was showing all memory that was left allocated. It should have run a garbage collection pass beforehand, so it could be sure that the stuff it was showing was actually a memory leak, and not just stuff that was left hanging around. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-10 by @gfwilliams That's fine - there are one or two tests in there that don't pass - to remind me of things that need doing :) test_pipe.js passes on mine, but it's probably just because test.txt doesn't exist, |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-10 by asandford OK, thanks :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-21 by user52580 quit() doesn't work in the last build.
Update: this is strange but "quit" works. I did "make clean; make" and "quit" works after rebuild. But it is possible that I only miss something, that I did some action and espruino damaged internal data structures and that was a reason why "quit" was not working. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-02-23 by @gfwilliams Thanks for the update. If you used |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-06-06 by veryalien SOLVED! It was mostly a "betwwen-the-ears" problem! ;) I looked through the code until I found what I needed to know. The call to "wiringPiSetup" confirmed that the normal GPIO numbers should be used (I'm using sudo). I didn't want to risk blowing up any GPIO pins by putting buttons on output pins. However, after reading the code, it looks like the correct pin mode is always set for reads or writes, which probably means it's more difficult to blow up the pins. Original message is here, so you can still read about the "problem": I've got Espruino compiled, built and running on the raspberry pi. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-06-08 by @gfwilliams Great - glad you got it sorted! Yes, unless you use |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-24 by user58552 My 9 year old son is an avid user of the scratch programming language and we are working on a modest weather station together. We have light, humidity and temperature sensors attached to a Raspberry Pi. The Raspberry Pi is headless which really limits his options for programming the thing. Thanks to Google I wound up here and quickly configured the Raspberry Pi to work with the Web IDE. On my son's laptop running Chrome I installed the IDE. I made the following two configuration adjustments: As root (relax, this isn't a mission critical server) I did the following:
Next I installed the socat program.
Then, I determined the TTY device of my serial port
In my case the serial device is 'ttyAMAo' Next I opened /etc/inittab in an editor and ensured that no programs were using /dev/ttyAMAo. Now that I think of it, you may also need to edit the grub config and remove any serial console parameters passed to the kernel. I leave this as an exercise for the reader. Finally, I added the following to /etc/inittab
Next I instructed init to re-read the configuration
The Espruino prompt immediately appeared on the IDE. I switched to the graphical editor and it worked too. And just like that my son can explore physical computing on a Raspberry Pi using Espruino. Time to visit your store and order some boards. I see lots of little creations in his future. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-24 by @gfwilliams That's great! Thanks for posting that up! I'd never really considered using the Web IDE with a Pi before, but it makes a lot of sense! A few weeks ago I made it so the Web IDE can connect to a network server. I wonder if you could somehow use that with Espruino on the Pi... Maybe just a telnet server or something? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-24 by user58552 Gordon, Configuring Espruino to be available over the network is trival (and wildly insecure). I used the following command, as root:
All that is left to do is configure Espruino Web IDE to connect via a socket and not the serial port. :) Regards |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-24 by user58552 There are implications that anyone attempting the above should be aware of. Chiefly, the above command will spawn a new instance of Espruino on the raspberry pi each time the Web IDE connects. It is unlikely this is desireable, I will work on a technique that attaches an incoming port to an already running Espruino instance. Reattaching to a previous session is what people likely expect. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2015-10-26 by @gfwilliams That's great - thanks! As you say, horribly insecure, but fun if you're just playing around locally. I guess you might be able to make it persist using |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-09 by hygy So I have an orange pi zero, cloned the espruino repo, successfully compilled it and it is runing:
I cloned and compiled wiringOP:
Now how can I access orange pi zero gpio from espruino? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-10 by @gfwilliams If you recompile Espruino once the wiring-dev libs are installed, the warning about missing wiringpi libs should disappear. If you then run as sudo it should start as normal, but when you access the GPIO it'll do it directly |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-21 by dave_irvine Has anyone ever investigated running Espruino natively on the Raspberry Pi, i.e without Raspbian underneath? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-05-22 by @gfwilliams There was a post on it here: http://forum.espruino.com/conversations/278380/?offset=25#comment13427964 And I think some others too. It should well be possible, but I'm not sure it's worth it since you'll spend 90% of your time re-writing networking/graphics/sound/usb/etc libraries. I believe you can get realtime linux kernels for the Pi though, and if you just ran Espruino with one of them you should get something very similar with very little effort :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-12-18 by @gfwilliams
I'm not sure if anyone has tried it recently, but Espruino has been available for the Pi for years.
Having discovered wiringPi a few weeks ago, I decided to have another play around. It actually makes Espruino on the Pi really interesting.
When run with 'sudo' it has...
setWatch
that uses interruptsSerial1.setup(9600,{....path:"/dev/ttyUSB0"})
)With the newest Raspbian images, installation is pretty simple too. On a clean install, log in and do:
Anyway, the exciting thing is setWatch really. I just plugged a 433Mhz radio receiver straight into one of the GPIOs and I can actually decode 433Mhz signals with it - using the exact same code that was used on the Espruino board.
Given the price of Raspberry Pis now this could make a really interesting all-JavaScript base station. The extra oomph of the Raspberry Pi means it should be a lot more reliable when it comes to decoding radio signals.
Beta Was this translation helpful? Give feedback.
All reactions