gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

freeRTOS for Raspberry Pi Home Automation?!

Tue Apr 05, 2016 8:21 am

Hello.
I've been experimenting with the raspberry pi alot for a year now. Mostly it was home automation like from web server turn on lights and such.
Of course this was using raspbian.

My question is should I try freeRTOS or some kind of RTOS for my home automation?

Cheers!

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: freeRTOS for Raspberry Pi Home Automation?!

Tue Apr 05, 2016 9:43 am

Stick with Raspbian you don't need super accurate timing. A clock resolution of one second is perfectly OK for home automation.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

gproduct
Posts: 59
Joined: Tue Aug 11, 2015 1:27 pm

Re: freeRTOS for Raspberry Pi Home Automation?!

Tue Apr 05, 2016 10:30 pm

okay.
But can I have a web server on freertos?
And will the super accuracy use power and go to waste?
I would only install it just to learn something new

User avatar
DougieLawson
Posts: 39124
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: freeRTOS for Raspberry Pi Home Automation?!

Thu Apr 07, 2016 8:09 am

You don't want to lose the functions and features that Linux gives you, it's not worth it.

FreeRTOS is a stripped down operating system which has lots of function removed so that system timing becomes accurate and predictable and processes won't get pre-empted by the system's dispatcher. Their goal is micro second timing accuracy which isn't needed for most general purpose computing.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

jahboater
Posts: 5759
Joined: Wed Feb 04, 2015 6:38 pm
Location: West Dorset

Re: freeRTOS for Raspberry Pi Home Automation?!

Thu Apr 07, 2016 8:26 am

Take a look at the POSIX clock_gettime(), the resolution is far better than 1 sec. The field is nano-seconds, but of course its not as good as that. And you have a choice of clocks, some of which guarantee monotonicity even with TOD clock adjustments. Its part of the standard C library in Raspbian. See "man clock_gettime".
Not that you need this sort of precision for home automation.
Pi4 8GB running PIOS64

Pithagoros
Posts: 578
Joined: Wed Nov 12, 2014 8:16 pm

Re: freeRTOS for Raspberry Pi Home Automation?!

Thu Apr 07, 2016 8:58 am

FreeRTOS is quite a fun thing to play with and I would recommend having a play with it to get it working and add FreeRTOS it to your knowledge arsenal.

Everything you do with it will require more work than with Raspbian though, you can configure a TCP/IP stack, and it is possible to get it to serve basic HTML over http with a bit of work and some add ons from the web.

Return to “General discussion”