Showing posts with label GPIO FreeRTOS. Show all posts
Showing posts with label GPIO FreeRTOS. Show all posts

Sunday, June 26, 2016

More devices IN

I've completed to code to add more devices, so now the module as common code can:


  • update from OTA server if the version on server is bigger the its own version of code
  • get the data from AUTH server (topics, type, MQTT server etc, credentials)
  • get the time from NTP server
  • log data to an external server
  • log debug data to a DEBUG server
  • do  CRON tasks on GPIO pins based on schedule received from Android App
  • send status and its state to Android app.


All these features are part of the common code that will run an all my modules.
Now sky is the limit on what each module can do : 

  • temperature,
  • humidity, 
  • noise, 
  • presence,
  • gas detection, 
  • acceleration, 
  • vibration, 
  • measuring power consumption, 
  • controlling blinds, 
  • garage door, 
  • boiler, 
  • irrigation controller, 
  • fish tank, 
  • motors, 
  • air conditioning or a thermostat etc
  • coffee machines
  • washing machines
  • fridge
  • remote control substitute for TV, Satellite dish, Cable TV or any other IR
  • power sockets
  • exterior lights
  • interior lights
  • power sockets
  • air quality
And the beauty is that I am not limited by the WiFi, the same things I can do with my new LoRa modules.

The all power will be at your finger tips.


 Obs: Later I'll try to add some Artificial Intelligence (AI) to my system, because the IoT without AI  is pretty  much limited on manually or semi automatic control.





Tuesday, April 26, 2016

Configuring and trigger GPIO on FreeRTOS



On my MQTT broker I wanted to have also a visual view of incoming packets along with monitoring the WiFi connection.

To do that I need to control the RGB led connected on my Witty module.

Controlling the GPIO assume two steps:

1. Configuring the GPIO

        #include "gpio.h"
        #define LED13_GPIO 13

    GPIO_ConfigTypeDef led13;
    led13.GPIO_Pin = GPIO_Pin_13;
    led13.GPIO_Mode = GPIO_Mode_Output;
    led13.GPIO_Pullup = GPIO_PullUp_DIS;
    led13.GPIO_IntrType = GPIO_PIN_INTR_DISABLE;

    gpio_config(&led13);

2. Triggering the GPIO 

    GPIO_OUTPUT_SET(LED13_GPIO,1); 
    vTaskDelay(100 / portTICK_RATE_MS);

    GPIO_OUTPUT_SET(LED13_GPIO,0);