WebReflection
Posts: 6
Joined: Tue Jun 28, 2016 3:18 pm

Meet B.E.N.J.A.

Tue Jun 28, 2016 3:33 pm

Bootable Electron Node JS Application is the name of my latest experiment which aim is to provide an Hardware Accelerated boot to Electron, previously known as GitHub Atom Shell, in order to have a Kiosk like Application with all GPIO available through johnny-five and raspi-io.

A little demo on a led switched on through a simple Webpage is here, together with more details and used code.

Right now all you need to do is burn the appropriate image into a microSD card with at least 8GB of space; that's it.
You can develop on your computer plugging the SD card, reaching the BENJA-APP disk/folder, writing the following via terminal:

Code: Select all

npm start
That's really it.

Electron, NodeJS, and npm, are currently only dependency you need to develop something great.
You can also use rmate to deploy remotely, it's already available.

I'd love to know your opinion about this project, which is also entirely Open Source, and not targeting just the Raspberry Pi.

Thanks in advance for any sort of feedback.

tonywaite
Posts: 30
Joined: Sat Sep 15, 2012 10:13 am

Re: Meet B.E.N.J.A.

Tue Jun 28, 2016 8:59 pm

This looks to be an exciting, effective and powerful development environment.
I can't wait to install it tomorrow and check it out - thank you so much!

WebReflection
Posts: 6
Joined: Tue Jun 28, 2016 3:18 pm

Re: Meet B.E.N.J.A.

Wed Jun 29, 2016 4:28 pm

Hello there!

The iso file is nothing but a raw

Code: Select all

dd if=/dev/mmcblk0 of=benja-rpi2.iso bs=8192
operation, so to have such iso back to an SD card of at least 8GB (you can have bigger one and use gparted afterward if needed) is the following:

Code: Select all

dd if=benja-rpi2.iso if=/dev/mmcblk0 bs=8192
You might need sudo privileges if you're either on Linux or MacOS.

Please note that /dev/mmcblk0 is my personal PC path/location for the SD card, be sure you find the right one for yours.

If you are on Windows though, you might want to try with a generic CD/DVD burner and eventually just rename the iso to img, if needed.

I haven't tried myself on Windows though, please let me know if you need further instructions.

Thank you!

WebReflection
Posts: 6
Joined: Tue Jun 28, 2016 3:18 pm

Re: Meet B.E.N.J.A.

Thu Jun 30, 2016 4:38 pm

Quick update:
https://www.youtube.com/watch?v=POSrH_TWkfg

This video shows how basic is the Benja OS workflo and it use HTML5 Canvas API to draw an image on a PiPiRus eInk screen

tonywaite
Posts: 30
Joined: Sat Sep 15, 2012 10:13 am

Re: Meet B.E.N.J.A.

Fri Jul 01, 2016 1:00 pm

Hi Andrea,

I feel that I am getting closer to BENJA, but am not there yet!

With the Pi3 as host and the benja-rpi2.iso file already copied to /home/pi, I did the following:

Firstly, I used my usual SDFormatter on the Win7 machine to prepare a 32GB card, with size-adjustment ON and volume label BENJA;
Then inserted it into the host Pi3 via a USB-reader, ran (df -h) and saw that the card was showing as /dev/sda1, auto-mounted as /media/pi/BENJA;
Then ran (sudo dd if=benja-rpi2.iso of=/dev/sda bs=8192); note that I referenced /dev/sda so that it overwrote /dev/sda1;
This completes properly; but when I boot from this card, it shows the rainbow splash, then four raspberry icons and then freezes;
The card looks to have the usual collection of directories and kernel7.img etc.

Where next should I look?

Regards, T o n y

WebReflection
Posts: 6
Joined: Tue Jun 28, 2016 3:18 pm

Re: Meet B.E.N.J.A.

Fri Jul 01, 2016 1:11 pm

It might take up to a minute to boot, it depends on the sd card speed. The boot is silent, you won't see anything until it starts . I've noticed the current image needs at least one input device, either touch screen, keyboard, or mouse, otherwise Weston complains. As summary, if you have dd-ed the card, the network cable is connected, you have an input attached, and you are seeing on your tv/screen something, it should be just a matter of seconds

tonywaite
Posts: 30
Joined: Sat Sep 15, 2012 10:13 am

Re: Meet B.E.N.J.A.

Fri Jul 01, 2016 2:09 pm

Hi Andrea,

Firstly, your help is very much appreciated!

I'm using my standard hardware setup that works everytime with Raspbian and Ultibo: Motorola Lapdock as monitor/keypad, Network cable plugged in.

The unit shows the rainbow splash, then the 'four raspberries' splash-screen. And stays showing the raspberries. The lights on the Network connector never light up.

In case there was something odd about the Lapdock, I booted with a standard USB keyboard instead and rebooted - no difference.

(I also tried removing the 'quiet splash' from cmdline.txt, but with no different outcome.)

When making the SDcard, the dd operation completed properly, with 130552+0 records in and out; 1069481984 bytes (1.1GB) copied at 12.9 MB/s;

I've also tried a new SDcard from a different manufacturer.

I'm no Ninja, so bear in mind that I may have overlooked something 'obvious'!

The fileset shown is the overlays directory, bcm2709 and 2710 dtb files, bootcode.bin, cmdline and config textfiles, fixedup dat files and kernel7.img.

WebReflection
Posts: 6
Joined: Tue Jun 28, 2016 3:18 pm

Re: Meet B.E.N.J.A.

Fri Jul 01, 2016 2:29 pm

Reason I should actually enable the "buy SD card" sooner than later, apologies this is not going as smooth as it should.

So, the ISO file is zipped, but once extracted it is around 8GB.
If your dd operation copies 1.1 GB either you are copying over the .zip or there's something very wrong.

The procedure should be straight forward if you can use dd, no extra software would be needed at all.

The ISO will create a bootable SD card with 3 partitions: the vfat boot, the ext4 root, and the vfat BENJA-APP.

Do not change or modify for any reason these partitions, at least not now, otherwise I cannot rule out some other software is on the way.

The SD card should be at least 8GB but if it's bigger it's OK. Do not resize anything, do not make it dynamic (yet).

If you have a *nix compatible console please open it, and cd into the directory with the benja-rpi2.zip file

I am assuming you know how to dd the card, I will refer at such path as /dev/sdX. Be sure you are not using any number when you refer to such path because you want to use the card, not its partitions.

Code: Select all

SD_CARD=/dev/sdX
unzip benja-rpi2.zip
sudo umount ${SD_CARD}*
sudo dd if=benja-rpi2.iso of=${SD_CARD} bs=8192
sync
The dd shold show that you actually copied about 8GB of data, not 1.1, rather 7.9.

Once you've done this, put into your RPi being sure the network cable is in and there is an input attache to it.

It works 10 times out of 10 via both Linux and OSX here; if you have a proper Linux console on Windows I don't see why it shouldn't work in there too.

Please let me know how it goes.

tonywaite
Posts: 30
Joined: Sat Sep 15, 2012 10:13 am

Re: Meet B.E.N.J.A.

Fri Jul 01, 2016 4:09 pm

Hi Andrea - all is now well and I have Benja booting from the SDcard and visible from a browser on my main PC over the network.

For anyone following after me, here's the exact recipe for doing it on the Pi:
I downloaded benja-rpi2.zip using the Browser, then used File Manager from the GUI to transfer it from the downloads directory into /home/pi;
Then ran (unzip benja-rpi2.zip) - which took minutes;
Then inserted a formatted SDcard via a USB-reader; ran (df -h) and saw the card at /dev/sda1;
Unmounted it by running (umount /dev/sda1);
Then ran (sudo dd if=benja-rpi2.iso of=/dev/sda bs=8192); (note 'sda' not 'sda1'); this took many minutes too;

This successfully made the bootable Benja SDcard, which I could see over the Network from my host PC.

Andrea - thank you so much for taking such time and trouble to help me!

Regards,
T o n y

WebReflection
Posts: 6
Joined: Tue Jun 28, 2016 3:18 pm

Re: Meet B.E.N.J.A.

Fri Jul 01, 2016 5:13 pm

Glad you finally managed to have a working SD Card.

Just one note though, please note that /dev/sda is usually the main disk on most Linux distro so, be careful with dd because you might start wiping out disks that you shouldn't.

This is not for you, rather for possible future/other readers, in case they try to do the same from OSX or any other Linux distro.

Please let me know how you liked the B.E.N.J.A. idea, thank you!

Return to “Other projects”