• Categories
    • Recent
    • Tags
    • Popular
    • Register
    • Login
    1. Home
    2. Stephan35
    3. Posts
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 5
    • Posts 35
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: MyControllerDevice and OTA Firmware device update , should it work ?

      @Emmanuel
      Sorry, I have not looked at this problem since the last time.

      posted in MyControllerDevice (ESP8266)
      Stephan35S
      Stephan35
    • RE: ESP8266 - analogRead(A0) return 65535

      @njbuch said:

      @Stephan35 Indeed but my voltage divider used was aiming for 0.0 - 3.3 and resulting output was over 1 volt most of the time, which means that I am reading 65535 all the time. I need a new one.

      I am looking in my bins after a few resistors that matches my photo-resistor specs. Will revert when successfull. I am using: http://www.ohmslawcalculator.com/voltage-divider-calculator to find the right combination.

      Sorry,
      answer is there : analogRead(A0) return 65535

      You have to modify Myconfig.h

      #define ENABLE_READ_VCC
      
      posted in MyControllerDevice (ESP8266)
      Stephan35S
      Stephan35
    • RE: ESP8266 - analogRead(A0) return 65535

      @njbuch
      You have to adjust electonic input with a input divide voltage :
      0_1489325656696_photo_bb.gif.png

      You will find full of example to explain how to.

      A i tried to explain, my example need to be improve , tested, and modified as need.

      Best regards.

      posted in MyControllerDevice (ESP8266)
      Stephan35S
      Stephan35
    • RE: ESP8266 - analogRead(A0) return 65535

      @njbuch said:

      Can you show your exact working example?

      Here is my full example :

      #include <MyController.h>
      
      MyController mc;
      
      
      
      
      #define SENSOR_LED_BLEU "LED BLEU"
      #define SENSOR_LED_ROUGE "LED ROUGE"
      #define SENSOR_LED_VERTE "LED VERTE"
      #define SENSOR_LUXMETRE "LUXMETRE"
      #define BP_GPIO4 "Bouton RESET"
      #define BP_GPIO5 "Bouton Test 1"
      #define BP_GPIO14 "Bouton Test 2"
      
      //Relay pins
      #define PIN_RELAY_1 2
      #define PIN_BP_GPIO4 4
      #define PIN_BP_GPIO5 5
      #define PIN_LED_VERTE 12
      #define PIN_LED_BLEU 13
      #define PIN_BP_GPIO14 14
      #define PIN_LED_ROUGE 15
      
      
      
      //Sensors
      #define SENSOR_RELAY_1 "relay-1"
      
      
      
      
      unsigned long lastRecu = 0;
      bool Gpio5_Checked = false;
      bool Gpio14_Checked = false;
      unsigned long Gpio5_millis = 0;
      unsigned long Gpio14_millis = 0;
      
      unsigned long Scan_Gpio = 0;
      int Gpio4_S = 0; // Gpio 4 state
      int Gpio5_S = 0; // Gpio 5 state
      int Gpio14_S = 0; // Gpio 14 state
      int Gpio4_LS = 0; // Gpio 4 Last state
      int Gpio5_LS = 0; // Gpio 5 Last state
      int Gpio14_LS = 0; // Gpio 14 Last state
      
      
      //in_esp/ESP_8C0125/LUXMETRE/C_SET/V_LIGHT_LEVEL/0
      //n_esp/ESP_8C0125/LUXMETRE/C_SET/V_LEVEL/0
      
      //out_esp/ESP_8C0125/SENSOR_BC/C_INTERNAL/LUXMETRE/0
      //_message.update(BC_SENSOR, C_INTERNAL, SENSOR_LUXMETRE);
      
      
      void sendLUX(){
        McMessage _message;
        //_message.update(SENSOR_LUXMETRE, C_SET, "V_LIGHT_LEVEL");
        //char _luxmeter[21];
       // snprintf_P(_luxmeter, 20, "%s", analogRead(A0) );
        Serial.print("Envoie de Luxmeter:");
        Serial.println(analogRead(A0));
        //snprintf_P(_luxmeter, 20, "%d", String(analogRead(A0)));
        ////send(_message.set(_luxmeter));
        _message.update(SENSOR_LUXMETRE, C_SET, V_LEVEL);
        //snprintf_P(_luxmeter, 20, "%d", analogRead(A0));
        send(_message.set(analogRead(A0)));
      }
      
      //in_esp/ESP_8C0125/Bouton Test/C_SET/V_TRIPPED/0
      /*
      void sendPin5(){
        McMessage _message;
        _message.update(BP_GPIO5, C_SET, V_TRIPPED);
        if (digitalRead(PIN_BP_GPIO5) == HIGH){
        	send(_message.set(1));
        	Serial.println("BP = 1");
        }
        if (digitalRead(PIN_BP_GPIO5) == LOW){
        	send(_message.set(0));
        	Serial.println("BP = 0");
        }
      }
      void sendPin14(){
        McMessage _message;
        _message.update(BP_GPIO14, C_SET, V_TRIPPED);
        if (digitalRead(PIN_BP_GPIO14) == HIGH){
        	send(_message.set(1));
        	Serial.println("BP2 = 1");
        }
        if (digitalRead(PIN_BP_GPIO14) == LOW){
        	send(_message.set(0));
        	Serial.println("BP2 = 0");
        }
      }
      */
      
      void sendPin4(int val){
        	McMessage _message;
        	_message.update(BP_GPIO4, C_SET, V_STATUS);
        	send(_message.set(val));
        	Serial.print("Changement de Pin4 : ");
        	Serial.println(val);
      }
      
      void sendPin5(int val){
        	McMessage _message;
        	_message.update(BP_GPIO5, C_SET, V_STATUS);
        	send(_message.set(val));
        	Serial.print("Changement de Pin5 : ");
        	Serial.println(val);
      }
      void sendPin14(int val){
        	McMessage _message;
        	_message.update(BP_GPIO14, C_SET, V_STATUS);
        	send(_message.set(val));
        	Serial.print("Changement de Pin14 : ");
        	Serial.println(val);
      }
      
      /*
      void Pin5Change(){
      	if (millis() - Gpio5_millis > 75){
          	delayMicroseconds(32000);
          	Serial.println("\n*** Pin5 Interrupt");
          	Gpio5_Checked = true;
          	Gpio5_millis = millis();
          	detachInterrupt(PIN_BP_GPIO5);
          }
      }
      void Pin14Change(){
      	if (millis() - Gpio14_millis > 75){
      	    delayMicroseconds(32000);
      	    Serial.println("\n*** Pin14 Interrupt");
      	    Gpio14_Checked = true;
      	    Gpio14_millis = millis();
      	    detachInterrupt(PIN_BP_GPIO14);
      	}
      }
      */
      
      
      
      void before(){
        //Your code before this library inialize
      }
      
      void presentation(){
        //Send node name and version information
        sendSketchInfo("Module de test", "1.0.0");
      
        //Send sensor name and type
        present(S_BINARY, SENSOR_RELAY_1, "Relay 01");
        //request current status
        request(SENSOR_RELAY_1, V_STATUS);
      
      
        present(S_BINARY, SENSOR_LED_BLEU, SENSOR_LED_BLEU);
        //request current status
        request(SENSOR_LED_BLEU, V_STATUS);
      
        present(S_BINARY, SENSOR_LED_ROUGE, SENSOR_LED_ROUGE);
        //request current status
        request(SENSOR_LED_ROUGE, V_STATUS);
      
        present(S_BINARY, SENSOR_LED_VERTE, SENSOR_LED_VERTE);
        //request current status
        request(SENSOR_LED_VERTE, V_STATUS);
      
        //present(S_LIGHT, SENSOR_LUXMETRE, SENSOR_LUXMETRE);
        //request(SENSOR_LUXMETRE, "V_LIGHT_LEVEL");
      
      
        present(S_DIMMER, BP_GPIO4, BP_GPIO4);
        request(BP_GPIO4, V_STATUS);
      
        present(S_DOOR, BP_GPIO5, BP_GPIO5);
        request(BP_GPIO5, V_STATUS);
      
        present(S_DOOR, BP_GPIO14, BP_GPIO14);
        request(BP_GPIO14, V_STATUS);
      
      }
      
      void receiveTime(unsigned long mcTimestamp){
        //Do something with received time
      }
      
      void receive(McMessage &message) {
      	if(message.isSensorOf(SENSOR_RELAY_1) && message.isSubTypeOf(V_STATUS)){
      	    digitalWrite(PIN_RELAY_1, message.getUInt());
      	}
      	if(message.isSensorOf(SENSOR_LED_BLEU) && message.isSubTypeOf(V_STATUS)){
      	    digitalWrite(PIN_LED_BLEU, message.getUInt());
      	}
      	if(message.isSensorOf(SENSOR_LED_ROUGE) && message.isSubTypeOf(V_STATUS)){
      	    digitalWrite(PIN_LED_ROUGE, message.getUInt());
      	}
      	if(message.isSensorOf(SENSOR_LED_VERTE) && message.isSubTypeOf(V_STATUS)){
      	    digitalWrite(PIN_LED_VERTE, message.getUInt());
      	}
      }
      
      
      void setup() {
          pinMode(A0, INPUT);
        	pinMode(PIN_BP_GPIO4, INPUT);
        	pinMode(PIN_BP_GPIO5, INPUT);
        	pinMode(PIN_BP_GPIO14, INPUT);
        	pinMode(PIN_RELAY_1, OUTPUT);
        	pinMode(PIN_LED_BLEU, OUTPUT);
        	pinMode(PIN_LED_ROUGE, OUTPUT);
        	pinMode(PIN_LED_VERTE, OUTPUT);
        	if(!isSystemConfigured()){
          //You can check, does this node/device configured. If no you can display/blink some led from here.
        	}
        //attachInterrupt(PIN_BP_GPIO5, (Pin5Change), CHANGE);
        //attachInterrupt(PIN_BP_GPIO14, (Pin14Change), CHANGE); //digitalPinToInterrupt(x)
      }
      
      void loop() {
      	mc.loop();
      	long now = millis();
      	if (now - Scan_Gpio > 200 ){
      		Gpio4_S = digitalRead(PIN_BP_GPIO4);
      		Gpio5_S = digitalRead(PIN_BP_GPIO5);
      		Gpio14_S = digitalRead(PIN_BP_GPIO14);
      		if (Gpio4_S != Gpio4_LS ){
      			sendPin4(((Gpio4_S == HIGH) ? 1 : 0));
      			Gpio4_LS = Gpio4_S;
      		}
      		if (Gpio5_S != Gpio5_LS ){
      			sendPin5(((Gpio5_S == HIGH) ? 1 : 0));
      			Gpio5_LS = Gpio5_S;
      		}
      		if (Gpio14_S != Gpio14_LS ){
      			sendPin14(((Gpio14_S == HIGH) ? 1 : 0));
      			Gpio14_LS = Gpio14_S;
      		}
      		Scan_Gpio = now;
      		Serial.print(".");
      
      	}
        
        /*
        if (Gpio5_Checked) {
        	Gpio5_Checked = false;
        	sendPin5();
        	yield();
        	attachInterrupt(PIN_BP_GPIO5, (Pin5Change), CHANGE);
        }
        if (Gpio14_Checked) {
        	Gpio14_Checked = false;
        	sendPin14();
        	yield();
        	attachInterrupt(PIN_BP_GPIO14, (Pin14Change), CHANGE);
        }
        */
        //You can add your logic here.
        	if (now - lastRecu > 30000 ) {
          	lastRecu = now;
          	//sendRSSI();
          	sendLUX();
          	//send(SENSOR_LUXMETRE, analogRead(A0));
        	}
      }
      
      

      Take care of this : need to be improve , i am a beginer with MyController , and this example is not clean !

      Hope will help you

      Best regards.

      posted in MyControllerDevice (ESP8266)
      Stephan35S
      Stephan35
    • RE: Is it possible to use device with udp protocol ?

      @jkandasa said:

      Give me some hints, if you have any?

      ok, i go again with udp and node-red , i will send you back all i understood.

      2 way for node ,
      first in loop every 150ms max , listen udp port (i will confirm back).
      second , use async udp of menodev wich work fine for me.

      So that mean MyController maybe have to get also async udp to unmiss udp data.

      I meet some issue with broadcasting, because i created mesh in udp.

      Also i used ascii udp datagramm , basic but easiest way for me : something like "down|nodename|get|gpio1"
      "up|nodename|result|gpio1|0"
      "down|nodename|set|gpio1|1"

      Every node can read udp, so , it is very important to specify way and kind of action.

      Hope will help.

      Best regards.

      posted in General Discussion
      Stephan35S
      Stephan35
    • RE: Need volunteer to test dualboot OTA with MyController

      I do not use MySensors node (with NRF24)
      I only use zwave and esp8266 node .
      So will buy some nrf24 to test with my uno
      just have to wait a little ..... 3 weeks 😬

      Oops, do you think about this product : NRF24L01 smd

      I will take also these : NRF24L01

      posted in General Discussion
      Stephan35S
      Stephan35
    • RE: Is it possible to use device with udp protocol ?

      Thanks,
      I know about dataloss with udp .
      Too many data send may flood lan.
      Also i tried async udp with esp8266 , created a mesh with other esp work fine.
      in fact i losed data when sending or receiving tcp request pendind udp request.
      best regards

      posted in General Discussion
      Stephan35S
      Stephan35
    • Is it possible to use device with udp protocol ?

      Hello
      What do you think about UDP ?
      Is it possible to add an udp listener ? (like node-red)
      Thanks.
      Best regards

      posted in General Discussion
      Stephan35S
      Stephan35
    • RE: Need volunteer to test dualboot OTA with MyController

      Hello ,
      If i can do it, with pleasure .
      Best regards

      posted in General Discussion
      Stephan35S
      Stephan35
    • RE: MyControllerDevice and OTA Firmware device update , should it work ?

      Hello,
      Here is some news :

      Really nothing append when i ask to update firmware.

      /* User configurable variables */
      /* ***************************************************************************** */
      // Enable DEBUG in sketch to show debug prints.
      #define ENABLE_ERROR
      #define ENABLE_INFO
      #define ENABLE_DEBUG
      //#define ENABLE_TRACE
      

      Resources logs :

      2017-03-02 21:47:31,788 INFO [main] [org.mycontroller.standalone.db.DataBaseUtils:166] Application information: [Version:0.0.3.Final-SNAPSHOT, Database(type:H2 database embedded, version:1.4.193 (2016-10-31), schema version:1.03.05 - 2016 Nov 18), Built on:2017-02-22T13:38:19+0100, Git commit:8dd52693413b8a9cc6196bd77203ac69f4852ea3:development]
      2017-03-02 21:47:31,830 INFO [main] [org.mycontroller.standalone.db.DataBaseUtils:191] Reload DAO triggered...
      2017-03-02 21:47:33,536 INFO [Thread-6] [org.mycontroller.standalone.message.RawMessageQueue:54] Cleared offline messages[0] from the queue.
      2017-03-02 21:47:34,436 INFO [main] [org.mycontroller.standalone.gateway.mqtt.MqttGatewayImpl:67] MQTT Gateway[name:MQTT for ESP8266, URI:tcp://localhost:1883, NetworkType:MyController] connected successfully..
      2017-03-02 21:47:42,663 INFO [main] [org.mycontroller.standalone.StartApp:211] TJWS server started successfully, HTTPS Enabled?:true, HTTP(S) Port: [8443]
      2017-03-02 21:47:42,721 ERROR [main] [org.mycontroller.standalone.mdns.McmDNSFactory:116] Unable to create mDNS registry service
      2017-03-02 21:47:42,728 INFO [main] [org.mycontroller.standalone.StartApp:109] MyController.org server started in [40721] ms
      

      Do i miss something ? (again ?)

      Best regards

      posted in MyControllerDevice (ESP8266)
      Stephan35S
      Stephan35
    • RE: Launch ./start.sh on startup , or like a service ?

      @Tag said:

      Another issue might be that the cript itself in incorrect.... make sure that the startup script starts with

      #!/bin/sh
      This is really important.

      Yes , it was that !

      Got also Orange Pi Zero 😉

      posted in Getting Started
      Stephan35S
      Stephan35
    • RE: ZWave support?

      Coninued on github.

      posted in General Discussion
      Stephan35S
      Stephan35
    • MyControllerDevice and OTA Firmware device update , should it work ?

      Hello,
      I tried to update my devices firmware , i miss something ? (Probably yes ...)

      I created a firmware . with bin file from Arduino compiler :
      0_1488020518584_Capture d’écran_2017-02-25_11-59-34.png

      Then i asked to my device to be updated :

      0_1488020605682_Capture d’écran_2017-02-25_12-03-11.png

      "Modifier un firmware" - > update firmware

      Reel text in french should be "Mettre à jour le firmware" , (more comprehensiv)

      Ok, then , what should be happening ?

      Thanks

      posted in MyControllerDevice (ESP8266) ota mycontrollerdev firmware device update
      Stephan35S
      Stephan35
    • RE: Launch ./start.sh on startup , or like a service ?

      @Tag
      Finally does not start at boot , missing something or, INIT is not correctly set.
      chkconfig -l display this :

      mountnfs.sh               0:off  1:off  2:off  3:off  4:off  5:off  6:off  S:on 
      mycontroller              0:off  1:off  2:on   3:on   4:on   5:on   6:off
      network-manager           0:off  1:off  2:on   3:on   4:on   5:on   6:off
      
      

      have a look later .
      Best regards

      posted in Getting Started
      Stephan35S
      Stephan35
    • RE: Launch ./start.sh on startup , or like a service ?

      @Tag Wonderfull !

      Just had this error :

      insserv: warning: script 'mycontroller' missing LSB tags and overrides

      I had to add this at the beginning :

      ### BEGIN INIT INFO
      # Provides:          MyController domotique
      # Required-Start:    $remote_fs $syslog
      # Required-Stop:     $remote_fs $syslog
      # Default-Start:     2 3 4 5
      # Default-Stop:      0 1 6
      # Short-Description: Start daemon at boot time
      # Description:       Enable service provided by daemon.
      ### END INIT INFO
      
      posted in Getting Started
      Stephan35S
      Stephan35
    • RE: ESP8266 - analogRead(A0) return 65535

      @jkandasa
      In fact To be fair, for now I am not able to judge if this is a bug or not, so I will not post anymore on github. 😆

      posted in MyControllerDevice (ESP8266)
      Stephan35S
      Stephan35
    • RE: ESP8266 - analogRead(A0) return 65535

      @jkandasa
      In fact i don't really know where i have to post ... what is your suggest about it ?
      Thanks

      posted in MyControllerDevice (ESP8266)
      Stephan35S
      Stephan35
    • RE: Launch ./start.sh on startup , or like a service ?

      @Tag

      Sorry, on linux.
      Should i use something like this

      sudo cp start.sh /etc/init.d
      sudo chmod +x /etc/init.d/start.sh
      sudo update-rc.d start.sh defaults

      To start

      sudo /etc/init.d/start.sh start

      To stop

      sudo /etc/init.d/start.sh stop

      Maybe rename start.sh to mycontroller.sh ?

      Is there no probleme with user and path to find mycontroller ?

      Thanks .

      posted in Getting Started
      Stephan35S
      Stephan35
    • RE: ZWave support?

      @jkandasa

      Hello, i have a zwave key with some devices.
      If you need some helper to test your job , i can . (if you want to)
      Best regards.

      posted in General Discussion
      Stephan35S
      Stephan35
    • ESP8266 - analogRead(A0) return 65535

      Hello,
      Something stange with MyControllerDevice Lib, I cannot read analogRead(A0) correctly, always return 65535 value .
      Is anybody have any idea of why ?

      void sendLUX(){
      McMessage _message;
      Serial.print("Envoie de Luxmeter:");
      Serial.println(analogRead(A0));
      _message.update(SENSOR_LUXMETRE, C_SET, V_LEVEL);
      send(_message.set(analogRead(A0)));
      }

      MC[I]: Initialization done...
      Envoie de Luxmeter:65535

      posted in MyControllerDevice (ESP8266) esp8266 analogread
      Stephan35S
      Stephan35