Page 1 of 1

freeRTOS for Raspberry Pi Home Automation?!

Posted: Tue Apr 05, 2016 8:21 am
by gproduct
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!

Re: freeRTOS for Raspberry Pi Home Automation?!

Posted: Tue Apr 05, 2016 9:43 am
by DougieLawson
Stick with Raspbian you don't need super accurate timing. A clock resolution of one second is perfectly OK for home automation.

Re: freeRTOS for Raspberry Pi Home Automation?!

Posted: Tue Apr 05, 2016 10:30 pm
by gproduct
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

Re: freeRTOS for Raspberry Pi Home Automation?!

Posted: Thu Apr 07, 2016 8:09 am
by DougieLawson
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.

Re: freeRTOS for Raspberry Pi Home Automation?!

Posted: Thu Apr 07, 2016 8:26 am
by jahboater
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.

Re: freeRTOS for Raspberry Pi Home Automation?!

Posted: Thu Apr 07, 2016 8:58 am
by Pithagoros
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.