WebIDE in Chromium #4665
Replies: 1 comment
-
Posted at 2015-05-04 by DrAzzy You very much want the WebIDE - it makes using modules much easier, not to mention the blockly editor. I suspect the problem is related to running it on the Pi; I haven't heard of anyone else using the Espruino without a real computer of some sort. Posted at 2015-05-05 by @gfwilliams @kolonuk - which version of Chromium do you have? It's possible that the one on the Pi is a much older release (I have Chromium v37 here that works fine). You might be able to find a newer build of it somewhere? You can connect with minicom/etc and play around, but as @drazzy says the IDE does provide some nice extras (including the block editor). If you have Node.js installed then you can use espruino-tools to get the nice features of the Web IDE, but from a CLI that lets you upload JavaScript files - but you're still missing having the nice interactive area at the same time as the editor. Posted at 2015-05-08 by kolonuk Thanks for replying - sorry, once again been busy this week! @drazzy - TBH, I could use my wife's PC, but only when she's out as I tend to experiment and break things, and she has a dissertation due in soon! @gfwilliams - I'm not at home right now to get the exact version, but I did apt-get install chromium and it reported it's the latest revision. Entirely possible the Raspbian repo is a bit behind - especially as I think Chromium is a little heavy on the Pi's resources therefore not a priority. I really would like the block editor (so I don't have to look up how loops are structured every time I want to use one!) - I'll find the Chromium version on the Pi, check up on any differences Raspbian may make, and also consider buying a new PC! Actually, I could have used one a few months ago for some VM testing... I am still confused by the permission value error - guess it could be down to webcam access...? Posted at 2015-05-08 by @gfwilliams
It's a bit of a hack, but you can actually use the block editor from the headphone jack with a bit of circuitry: https://github.com/espruino/EspruinoOrion Check out the 'One-way communication' heading. Honestly it's not going to be the nicest way to learn to program Espruino though :) If I were you I'd take a look at JavaScript though. It really is quite easy, once you get past the most simple things you'll find it's easy to use that than the block editor!
Possibly... As you've downloaded the source you could just delete stuff from Posted at 2015-05-08 by @allObjects @kolonuk, be aware of when using blockly, you cannot easily see what javascript is created on upload... therefore, blockly is not that much of help if you do not 'hack'/sniff the upload communication. In order to see what javascript has been uploaded to the board, you recall the second to last command in the console. (Regarding messing with and breaking our wife's PC: if you stick with a sandbox (see cog-whel setup - Project, where you can define a folder where all your things go), you cannot do real harm to the PC, and your stuff just stays in the sandbox). To see the uplaoded javascript, create - for example - the image-attached blockly code, upload it, then click into the console pane, and press twice the up-arrow button. This will recall into command mode the command sent for the upload, which is the uploaded code itself. NOTE: If you have more than one blockly block, you have to press the up-arrow button for each additional block. Espruino uploads them one by one in a command. @gfwilliams, I'm thinking about providing an option in 'blockly save' to save also/alternative as javascript code. (At the moment though, I'm on some other priorities and a bit short on time to have Espruino fun and explore the IDE code to add this... |:(... If you see this simply done, to run the upload-conversion part and save it into a same named, .js-suffixed file as the blockly code on blockly save, that would be very helpful for users in the same boat as @kolonuk.) - PS: Now also got to know what blockly's default is for the setWatch()-options object... ;-) ...for legibility witouth having to open the image separately, I added both 'sides' as own shots... and the code (with some formatting and fixes of missing semicolon 'error' WebIDE messages...).
Attachments: Posted at 2015-05-08 by @allObjects ...btw, the code does switch LED1 on and keeps it on for second on BTN1 press AND release event... But the way the code is written, the events meddle with each other and multiple timeouts are going on almost all the time (except you press and hold the button for more than one second (plus 10 milliseconds), then you release it and wait at least another second (plus 10 milliseconds), before a next press.... ;-). The requirement ...to turn the led on on button press and keep the led one more second on after releasing the button is quite nifty and asks for a bit a more sophisticated solution (see post, where instead a LED is turned on for a defined time, a sound is made. Posted at 2015-05-09 by kolonuk Right, I checked my Chromium version, it's v22, which is from 2012 - very old! I've played with the extention manifest, and it is the permissions line that is causing issues. Looking here, file system premissions were added in v23. With that removed I still can not get it to work (clicking on the WebIDE icon does nothing), and there are warnings in the Extentions tab (it doesn't recognise the keys short_name and url_handlers). Thanks @gfwilliams - As this looks like a dead end and the version is so old, I really don't think anyone should waste any more time on this. And thanks for pointing me towards the manifest - I've learnt something about extentions! And I'll definitely look at the audio hack - I did see that somewhere else too and was very intrigued. @allObjects - I managed to have a play on my work laptop, and realised at once that the blockly code doesn't reflect the code in the editor. Thanks for the up-arrow tip - that saves me having to transfer the file back to see the code! And yes, I've played with the sandbox before, but... I need to change the screen resolution, and that icon doesn't belong here. Why are all those photos on the desktop? Why is that plugged into that usb port? I can fix that with a script. Why is that so slow loading? How much memory is in there? That fan is very loud... ::Suddenly the screen goes blank:: Posted at 2015-05-11 by @gfwilliams
@allObjects There's an option in settings that allows you to set the contents of the text editor to what you sent with the graphical editor. That should solve your other issue too. @kolonuk ok, glad to see it works anyway! I wonder is v22 even has serial port support on it... I'm surprised there isn't a later build though - maybe you could find a package that someone else compiled? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2015-05-04 by kolonuk
Hi all,
I got my pico last week (thanks Gordon!)- didn't have any time last week so only just plugged it in. I immediately went and tried to install the webide, but for some reason it's not available for Chromium. I then went to github and downloaded the source to manually install, and got "invalid value for permission[2]".
Am i missing something, or should it just work?
I'm using a raspberry pi as my development platform (got rid of all my pc's lately) - would that have anything to do with it?
It's not a big issue, but as I have no Javascript experience, was hoping for the "block" editor to quickly produce basic code I can expand on.
Thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions