Blockly Events

Moderators: Voyager, BertB, grovkillen, Stuntteam, LisaM

Post Reply
Message
Author
LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Blockly Events

#1 Post by LisaM » 20 Jan 2018, 15:00

No matter how good they are, i'm unhappy with rules in ESPEasy. Rules are a compromise between extensibility and easy-of-use, making it neither.
I have implemented Scripts in uPyEasy (in Beta-1) and this wil give you full extensibility of uPyEasy firmware on the fly. There's no limitations what you can do to alter the behavior of uPyEasy, except off course the size of the Flash drive.
However it does require that you understand something about Python to make full use of it.

For those who don't want or can program Python, i'm thinking about another solution. I'm wondering if it is not better to use Blockly to program the events?
It would look something like this:
upyeasy blockly.JPG
upyeasy blockly.JPG (32.39 KiB) Viewed 27833 times
Please let me know what you think about Blockly or possible alternatives.

User avatar
ManS-H
Normal user
Posts: 279
Joined: 27 Dec 2015, 11:26
Location: the Netherlands

Re: Blockly Events

#2 Post by ManS-H » 20 Jan 2018, 15:48

I don't have program skills so rules and blocky are a good alternative for me.

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Blockly Events

#3 Post by Domosapiens » 20 Jan 2018, 20:34

Great Lisa !
Programming is soooo 1980 ;)
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: Blockly Events

#4 Post by AndrewJ » 20 Jan 2018, 22:56

Hi Lisa,
I'd not come across Blockly before but the ability to 'program' graphically is attractive. I don't know whether it would impose any limitations (memory etc, or more restricted functionality).
Hmmm, That's triggered another thought- I believe that NodeRED uses Python (presumably full python), wonder if it could be used sonehow. l don't know how "heavy" it is.
Anyway, worth exploring Blockly further.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Blockly Events

#5 Post by LisaM » 21 Jan 2018, 01:50

AndrewJ wrote: 20 Jan 2018, 22:56 Hi Lisa,
I'd not come across Blockly before but the ability to 'program' graphically is attractive. I don't know whether it would impose any limitations (memory etc, or more restricted functionality).
Hmmm, That's triggered another thought- I believe that NodeRED uses Python (presumably full python), wonder if it could be used sonehow. l don't know how "heavy" it is.
Anyway, worth exploring Blockly further.
Blocky is completely running on the client side, it's probably only feasible if the (javascript) library is stored locally on your own pc and only the result is loaded and saved to uPyEasy (similar to load/save settings). That way it won't take up valuable space in your SOC, while still benefiting from the GUI. Programming is mostly done from a single pc anyway, so this downside might be acceptable.
https://developers.google.com/blockly/guides/overview

AndrewJ
Normal user
Posts: 229
Joined: 14 Feb 2017, 12:38

Re: Blockly Events

#6 Post by AndrewJ » 21 Jan 2018, 16:51

Ah, I realise now, it's not on the SOC. It does look interesting. Thanks for the link.

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: Blockly Events

#7 Post by budman1758 » 27 Jan 2018, 19:24

+1
"The glass is twice as big as it needs to be".

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Blockly Events

#8 Post by BertB » 28 Jan 2018, 14:55

Well, it seems Rules no longer rulez.
No problem ... I have to go the python way anyway, but for getting things done quickly, Blockly is a nice alternative.

Having said that, one of the powerfull things in Rules is the handling of the output of the devices.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Blockly Events

#9 Post by LisaM » 28 Jan 2018, 17:28

BertB wrote: 28 Jan 2018, 14:55 Well, it seems Rules no longer rulez.
No problem ... I have to go the python way anyway, but for getting things done quickly, Blockly is a nice alternative.

Having said that, one of the powerfull things in Rules is the handling of the output of the devices.
Rules are still there, they are hidden by default just like in ESPEasy. Tools -> Switch on Rules checkbox and it's back!
Links to rules topic: viewtopic.php?f=23&t=4732

But... just like in ESPEasy, they are limited in functionality (they will grow a little bit until they have the same functionality as in ESPEasy.
Scripts are the full force, Blockly is more like rules. For all something to choose from.

Ps. Python is also used in ESPEasy, but only as supporting tool.

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: Blockly Events

#10 Post by budman1758 » 01 Feb 2018, 03:51

As a non-programmer its ESPEasy that allowed me to be able to get anything done that I wanted to do. Rules may be limiting but they do allow folks like me to get things working. There are any number of firmwares and program languages out there but ESPEasy is the only one I have found that's actually EASY. Rules are limiting but they are about as complex as I can understand. I'm just and old half broke down heavy equipment mechanic\welder with enough electronics know how to bash some hardware together and make it work. I would hate to see ESPEasy fall by the wayside. I understand that at some point it will reach a plateau where it cannot be extended anymore. Just hope it gets there.

Having said all that I'm all for uPyEasy too. Mebbe this ole broke down welder can figger it out. :lol:

Just my 2 cents worth. :mrgreen:
"The glass is twice as big as it needs to be".

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Blockly Events

#11 Post by LisaM » 01 Feb 2018, 18:44

budman1758 wrote: 01 Feb 2018, 03:51 As a non-programmer its ESPEasy that allowed me to be able to get anything done that I wanted to do. Rules may be limiting but they do allow folks like me to get things working. There are any number of firmwares and program languages out there but ESPEasy is the only one I have found that's actually EASY. Rules are limiting but they are about as complex as I can understand. I'm just and old half broke down heavy equipment mechanic\welder with enough electronics know how to bash some hardware together and make it work. I would hate to see ESPEasy fall by the wayside. I understand that at some point it will reach a plateau where it cannot be extended anymore. Just hope it gets there.

Having said all that I'm all for uPyEasy too. Mebbe this ole broke down welder can figger it out. :lol:

Just my 2 cents worth. :mrgreen:
Rules are also present in uPyEasy now, viewtopic.php?f=23&t=4732, but... Blockly can do the same thing, graphically and distributed (meaning client-server).
If an 'old half broke down heavy equipment mechanic\welder with enough electronics' no longer can work with uPyEasy, i have failed. Extending it means more complex possibilities, not less easy ways of programming uPyEasy. ;)

User avatar
budman1758
Normal user
Posts: 301
Joined: 15 Apr 2017, 05:13
Location: Riverside CA USA

Re: Blockly Events

#12 Post by budman1758 » 01 Feb 2018, 20:08

Blocky looks pretty cool. Looks like a bit of a chore to get it setup though.
"The glass is twice as big as it needs to be".

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Blockly Events

#13 Post by LisaM » 02 Feb 2018, 00:35

budman1758 wrote: 01 Feb 2018, 20:08 Blocky looks pretty cool. Looks like a bit of a chore to get it setup though.
It's a javascript library, no need for setup.

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Blockly Events

#14 Post by BertB » 02 Feb 2018, 10:05

@Lisa
What exactly do you mean with client/server here?
Doe the blockly made script reside in, let's say, Domoticz and control functions from there in a upyEasy of does the upyEasy download the script and run it locally?

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Blockly Events

#15 Post by LisaM » 02 Feb 2018, 11:46

BertB wrote: 02 Feb 2018, 10:05 @Lisa
What exactly do you mean with client/server here?
Doe the blockly made script reside in, let's say, Domoticz and control functions from there in a upyEasy of does the upyEasy download the script and run it locally?
It's a client-server based setup based on http communication:
- Client (browser on web, ios, android), containing the blockly library residing locally so the blockly library is NOT downloaded from uPyEasy
- Server (uPyEasy on SOC), containing the blockly 'rule' in XML. When editing the blockly rule, the xml is send from server to client and then stored again in uPyEasy for future editing. Or everything is done locally, blockly xml rule stored local, which is also possible. When everything is done locally, only the generated python rule is send to the server,
The blockly (xml based) rule has an option to generate python code from the blockly rule, this must be send to the server to run. The generated python code is identical to the current uPyEasy python based rules.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Blockly Events

#16 Post by manjh » 03 Feb 2018, 11:43

Domosapiens wrote: 20 Jan 2018, 20:34 Great Lisa !
Programming is soooo 1980 ;)
Really? Looking back, my days in Assembler were the best....

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Blockly Events

#17 Post by BertB » 03 Feb 2018, 13:00

Must say, I feel a bit disconnected too.

LisaM
Normal user
Posts: 513
Joined: 11 Apr 2017, 18:29

Re: Blockly Events

#18 Post by LisaM » 03 Feb 2018, 19:40

manjh wrote: 03 Feb 2018, 11:43
Domosapiens wrote: 20 Jan 2018, 20:34 Great Lisa !
Programming is soooo 1980 ;)
Really? Looking back, my days in Assembler were the best....
Assembler? OMG! :shock:
At work i've banned programming for about 80%!
We make models and computers are generating most efficient application code for us (with certified quality and traceability). No need for programming, unless it is something quite special (which doesn't happen a lot). Work is shifting towards the real intelligent work: how does the application need to function? Logical thinking instead of typing in code.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Blockly Events

#19 Post by manjh » 03 Feb 2018, 21:54

LisaM wrote: 03 Feb 2018, 19:40
manjh wrote: 03 Feb 2018, 11:43
Domosapiens wrote: 20 Jan 2018, 20:34 Great Lisa !
Programming is soooo 1980 ;)
Really? Looking back, my days in Assembler were the best....
Assembler? OMG! :shock:
At work i've banned programming for about 80%!
We make models and computers are generating most efficient application code for us (with certified quality and traceability). No need for programming, unless it is something quite special (which doesn't happen a lot). Work is shifting towards the real intelligent work: how does the application need to function? Logical thinking instead of typing in code.
Sure, keep dreaming. How do you think the compilers were built? Or even the firmware? Treasure what you have today, but donot deny what lies at the base...

BertB
Normal user
Posts: 1049
Joined: 25 Apr 2015, 14:39

Re: Blockly Events

#20 Post by BertB » 04 Feb 2018, 00:39

LisaM wrote: 03 Feb 2018, 19:40
manjh wrote: 03 Feb 2018, 11:43
Domosapiens wrote: 20 Jan 2018, 20:34 Great Lisa !
Programming is soooo 1980 ;)
Really? Looking back, my days in Assembler were the best....
Assembler? OMG! :shock:
At work i've banned programming for about 80%!
We make models and computers are generating most efficient application code for us (with certified quality and traceability). No need for programming, unless it is something quite special (which doesn't happen a lot). Work is shifting towards the real intelligent work: how does the application need to function? Logical thinking instead of typing in code.
Wonder why so many programs are so unlogical and often need so many hotfixes ...
😀
But okay, i am a bit of a Dinosaur.

TD-er
Core team member
Posts: 8643
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Blockly Events

#21 Post by TD-er » 05 Feb 2018, 09:38

manjh wrote: 03 Feb 2018, 21:54 [...]
Sure, keep dreaming. How do you think the compilers were built? Or even the firmware? Treasure what you have today, but donot deny what lies at the base...
True that there is still need for those kind of programming techniques and people to maintain them.
But the fact is that such knowledge is quite a specialism and often too complicated for most.
And if it is done right, abstraction will help people making less mistakes and achieve results with less work.

I've been programming in C++ a lot, but still find it a real burden sometimes to see how much effort it takes to do a simple task.
Working with ESPeasy makes me appreciate the -sometimes bloated- libraries available at my daytime job ;) and still allow me to get to the bottom of detailed bit-banging and old fashioned memory management.

manjh
Normal user
Posts: 516
Joined: 08 Feb 2016, 11:22

Re: Blockly Events

#22 Post by manjh » 05 Feb 2018, 10:24

I fully agree. The key is: use the proper technique for the job.
in most cases, using methods like Blockly is OK.

But when programming for the ISS (the Space Station, that is!) or one of the new medical operation robots, let's make sure we understand the code all the way down to the last bit...
Can you imagine an astronaut (during a spacewalk) or a surgeon (while doing open-heart surgery) reading on the screen: "unknown error. Please reboot." ... :-(

Having said that, I still maintain my original statement about having lots of fun when writing Assembler code...
Also, I think we should end this discussion as it is very much off-topic... :-)

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 4 guests