Page 1 of 1

PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 18 Dec 2016, 16:17
by moelski
Hi @all,

some days ago I found this awesome book from Neil Kolban:
https://leanpub.com/pi
I was really impressed about the huge amount of information he gave to us. For everyone who is interessted in the Pi this is a must to read 8-)

And at some point I stumbled about a project introduced by me-no-dev which is called "RasPiArduino":
https://github.com/me-no-dev/RasPiArduino

I get interested in that stuff and realized that you get a whole framework to program a Raspberry Pi from the Arduino IDE.
My first thought was ... "Why should I use the Arduino IDE to write C(++) code for the Pi :roll: ". But after a while the fog cleared and I started testing :D

The first test was to compile a blinky program. Works :shock:
The second test was a PCF8591 AD converter .. And after some trouble with sending the correct bytes to the device, it works, too :shock:
Next test was to check if we can access files on the filesystem (keep in mind ... from a Arduino sketch) ... works :shock:
Last but not least there was a network check ... works :shock:

Then I asked myself ... What will happen if I try to compile ESPEsay :roll: And well there where a hugh amount of errors.
But most of them could be fixed or bypassed. And after about 10 hours of coding it was done. ESPEasy is running on a Raspberry Pi Zero.

Now you may ask ... WHY the hell are you doing this :mrgreen:
First of all ... It´s fun and I learned a lot new things.
And I think there are some other benefits ...
* The Pi Zero costs about 5$ ... It´s a little bit bigger than a NodeMCU ESP ... But has a lot more power.
* You have a full accessible Linux system as base ... No bare metal like on the ESP8266
* You have native LAN / WLAN support
* There is a lot of space on the SD card for data handling / storage. And you can even use your network and access a NAS for example ...
* The PI has more GPIO´s than the ESP8266 (ok this meight change with the upcomping ESP32)
* Simple more processing Power
* You can run ESPEasy as a simple application on any running Raspian System
* You can Debug the Code 8-)
* as more as I`m thinking about I got more and more pros for this config :ugeek:

Ok that´s all for now. If you are interested in more details I can make a video with the compilation process and how it runs all together ...
And it would be possible to share my code on Github.

Would be nice to get some feedback on this stuff. And have a nice christmas and a happy new year.

Dominik

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 18 Dec 2016, 17:52
by r_255
Omg, espeasy is going PI :D
I love all these flavours of espeasy, i am going to order myself a pizero and have a look.

Today i copy and paste coded my 1st .ino file ever and that took me about 10hrs, so respect.... !

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 18 Dec 2016, 19:11
by papperone
That's brilliant idea!!
I've still some PiZero bought at 0.99$ from Microcenter somewhere and now I believe I've foudn how to use them for more fun!

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 19 Dec 2016, 02:36
by ILoveIOT
Yep,...that's a very brilliant idea !! Maybe this could also work on the Orange PI family, they have also some nice flavors;

$12.63 - H2 - Wifi - 100MB LAN - 512Mb http://www.orangepi.org/orangepizero/
$13.63 - H3 - HDMI - 100MB LAN - 512Mb http://www.orangepi.org/orangepione/
$24.55 - H5 - HDMI - 1GB LAN - 1GB http://www.orangepi.org/orangepipc2/

If this is working with the GPIO's on a Rasberry I can test it on a Orange PI PC, should be compatible.

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 19 Dec 2016, 12:19
by moelski
Hi !
PiZero bought at 0.99$
WOW :shock: Do you have a link for that ?
Maybe this could also work on the Orange PI family
I think this will not work out of the box .... OrangePi and Reasperry Pi using different cores.
And the RasPiArduino has a lot constants / definitions which refer directly to the BCM2835 Chip.

To get this running you need to enhance / or rewrite some of the RasPiArduino files which are relatet to the BCM2835 core.
Then it would work ... But it´s not as easy as it meight sound ... :roll:

And I should mention that there are still some little problems ...
* Task Load is to high for the process. I think that´s because of the delay(1) in the main loop ...
* File Read from the Webserver did not work correctly ...
But that can all be fixed sooner or later ;)

Dominik

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 19 Dec 2016, 14:20
by papperone
moelski wrote:Hi !
PiZero bought at 0.99$
WOW :shock: Do you have a link for that ?

Dominik
That was available a while ago only in the physical store and limited to one per customer.
I was by chance in USA for a business trip so every day I was goign to the Microstore shop to buy one, I ended up with four of them!!
I think that campaing is over as it seems they don't have currently any stock :(

EDIT: sorry I checked better and they still have some for 5$ (which is still a very good price) but indeed only if you live in US (or travel to!) and you can go to one of their shop who still has stock...

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 19 Dec 2016, 17:51
by NightBird
Hi,
Ok that´s all for now. If you are interested in more details I can make a video with the compilation process and how it runs all together ...
And it would be possible to share my code on Github.
Yes, I'm very interested, if you share your code...

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 20 Dec 2016, 14:57
by ILoveIOT
I think this will not work out of the box .... OrangePi and Reasperry Pi using different cores.
And the RasPiArduino has a lot constants / definitions which refer directly to the BCM2835 Chip.
Lol,..damm,..one dream less ;-)

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 11 Jan 2017, 07:53
by moelski
Hi everybody.

I decided to not longer spend time on this PiEasy port.
There are to many problems left and the overall performance of the resulting code is to bad.
I think on a Raspberry you can handle the things better with threads instead of timer.
And I definitely need serial (and maybe USB) inputs.

Since I need to control my power meter in the base I will write a new application.
The basics will be used from EspEasy.

If I have any news I will post a note here.

Dominik

Re: PiEasy - porting ESPEasy to Raspberry Pi (Zero)

Posted: 22 Jan 2017, 00:38
by ILoveIOT
Why not an easy esp look, for the front end, and simple scripts or programs at the backend ?

Then we would had an easy config webbased tool, for switching, temp, etc on a PI, would be nice to be compatible for the Rasbarry and Orange PI's.