Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Reza
    3. Best
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by Reza

    • RE: đŸ’Ŧ Building an Ethernet Gateway

      i have this problem:

      0;255;3;0;9;Starting gateway (RNNGA-, 2.0.0)
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;!TSM:RADIO:FAIL
      0;255;3;0;9;!TSM:FAILURE
      0;255;3;0;9;TSM:PDT
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;!TSM:RADIO:FAIL
      0;255;3;0;9;!TSM:FAILURE
      0;255;3;0;9;TSM:PDT
      0;255;3;0;9;TSM:INIT
      0;255;3;0;9;!TSM:RADIO:FAIL
      0;255;3;0;9;!TSM:FAILURE
      0;255;3;0;9;TSM:PDT
      

      i use ENC28J60 module . arduino nano + nrf24 + 4.7uf
      this code:

      #define MY_DEBUG 
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // When ENC28J60 is connected we have to move CE/CSN pins for NRF radio
      #define MY_RF24_CE_PIN 5
      #define MY_RF24_CS_PIN 6
      
      // Enable gateway ethernet module type 
      #define MY_GATEWAY_ENC28J60
      
      // Gateway IP address
      #define MY_IP_ADDRESS 192,168,0,110
      
      // The port to keep open on node server mode / or port to contact in client mode
      #define MY_PORT 5003   
      
      // Controller ip address. Enables client mode (default is "server" mode). 
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. 
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254   
      
      // The MAC address can be anything you want but should be unique on your network.
      // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
      // Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
      #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
      
      // Flash leds on rx/tx/err
      #define MY_LEDS_BLINKING_FEATURE
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Enable inclusion mode
      #define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      #define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      #define MY_INCLUSION_MODE_DURATION 60 
      // Digital pin used for inclusion mode button
      #define MY_INCLUSION_MODE_BUTTON_PIN  3 
      
      #define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
      #define MY_DEFAULT_RX_LED_PIN  8  // Receive led pin
      #define MY_DEFAULT_TX_LED_PIN  9  // the PCB, on board LED
      
      #include <SPI.h>
      #include <UIPEthernet.h>
      #include <MySensors.h>
      
      
      void setup()
      {
      }
      
      void loop() {
      }```
      posted in Announcements
      Reza
      Reza
    • RE: what is policy of mysensors?

      @mfalkvidd thank you my dear friend ❤

      posted in General Discussion
      Reza
      Reza
    • roller shutter

      hi
      this is a roller shutter sketch that i wrote 🙂 a simple sketch 🙂

      #define MY_DEBUG
      #define MY_RADIO_NRF24
      #define MY_RF24_CHANNEL 0
      #define MY_REPEATER_FEATURE
      #include MY_NODE_ID 20
      
      #include <SPI.h>
      #include <MySensors.h>
      
      #define RELAY_1  3
      #define RELAY_2  4
      
      
      
      void before() {
        int sensor = 1;
        pinMode(RELAY_1, OUTPUT);
        pinMode(RELAY_2, OUTPUT);
        digitalWrite(RELAY_1,HIGH);
        digitalWrite(RELAY_2,HIGH);
      
      }
      
      
      
      void setup() {
      }
      void presentation()
      {
        sendSketchInfo("Roller shutter", "1.0");
        int sensor = 1 ;
        present(sensor, S_COVER);
      }
      
      void loop() {
      }
      void receive(const MyMessage &message) {
        if (message.type == V_UP) {
          digitalWrite(RELAY_1, HIGH);
          delay(500);
          digitalWrite(RELAY_2, LOW);
        }
        if (message.type == V_STOP ) {
          digitalWrite(RELAY_1, HIGH);
          delay(500);
          digitalWrite(RELAY_2, HIGH);
        }
        if (message.type == V_DOWN) {
          digitalWrite(RELAY_2, HIGH);
          delay(500);
          digitalWrite(RELAY_1, LOW);
        }
      }
      
      posted in My Project
      Reza
      Reza
    • RE: some problem in sensor + repeater !

      @scalz
      so i test with wait 🙂 thank you my friend

      posted in Development
      Reza
      Reza
    • RE: Has anyone made a 2 or 4 channel relay , and is that worked correct ?

      @mfalkvidd
      thank you

      posted in Troubleshooting
      Reza
      Reza
    • RE: why mysensors is based on nrf24?

      @scalz
      thank you friend , this is good 🙏

      posted in General Discussion
      Reza
      Reza
    • RE: how add watchdog to my sensors?

      @Hermann-Kaiser
      hi thank you .
      for this sketch , where put your code?

      #define MY_DEBUG 
      #define MY_RADIO_NRF24
      #define MY_REPEATER_FEATURE
      
      #include <SPI.h>
      #include <MySensors.h>  
      
      #define CHILD_ID_LIGHT 0
      #define LIGHT_SENSOR_ANALOG_PIN 0
      
      unsigned long SLEEP_TIME = 30000; 
      MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
      int lastLightLevel;
      
      
      void presentation()  {
        sendSketchInfo("Light Sensor", "1.0");
        present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
      }
      
      void loop()      
      {     
        int lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; 
        Serial.println(lightLevel);
        if (lightLevel != lastLightLevel) {
            send(msg.set(lightLevel));
            lastLightLevel = lightLevel;
        }
        wait(SLEEP_TIME);
      }
      

      also this is for radio , but for arduino and sensor , how add watchdog ?

      posted in Development
      Reza
      Reza
    • RE: What is the difference between arduino nano (FT232 chip) and arduino nano CH340 chip ?

      thank you, I have a vera edge controller .

      posted in Troubleshooting
      Reza
      Reza
    • have not mysensors team any plans for add esp8266 ?

      hi friends
      thank you my sensors team.
      esp8266 is very good in connection. i test it with espeasy. i have very error in connection with nrf and have not rfm69. now i test espeasy with nodemcu and this is very good in connection, have not mysensors team any plans for add esp8266 similar to nrf and rfm ? i think this is very better for devices that dont use battery...

      posted in General Discussion
      Reza
      Reza
    • RE: Has anyone made a 2 or 4 channel relay , and is that worked correct ?

      @TheoL said:

      @Reza

      So I took your Sketch and refactored it. Just to be sure that nothing strange is in the code. I don't think there was anything strange in it. I just don't like the ID of defining one relay and calculate the others. But that's just me. I'd like to be able to debug, but with the way this sketch is set-up, checking what might be wrong is just harder to do.

      Haven't tested it on an Arduino, don't have any empty breadboard at the moment.

      #include <MySensor.h>
      #include <SPI.h>
      
      #define RELAY_1          3     // Arduino Digital I/O pin number for first relay (second on pin+1 etc)
      #define NUMBER_OF_RELAYS 2     // Total number of attached relays
      #define RELAY_ON         HIGH  // GPIO value to write to turn on attached relay
      #define RELAY_OFF        LOW   // GPIO value to write to turn off attached relay
      #define SKETCH_NAME      "Relay"
      #define SKETCH_VERSION   "1.0"
      
      // Construct MySensors library
      MySensor gw; // don't bother with singing yet. First get the sketch and hardware to work...!!!!
      
      void setup() {
        gw.begin( incomingMessage, AUTO, true ); // Initialize library and add callback for incoming messages
        gw.sendSketchInfo( SKETCH_NAME, SKETCH_VERSION); // Send the sketch version information to the gateway and Controller
      
        for ( int sensor = 0; sensor < NUMBER_OF_RELAYS; sensor++ ) {
          gw.present( sensor + 1, S_LIGHT );           // Present the actuator to the GW
          pinMode( RELAY_1 + sensor, OUTPUT );         // Assign Relay_pin as output
          digitalWrite( RELAY_1 + sensor, RELAY_OFF ); // turn of the relay (some relay need inverted value. You'll have to check yours.). Turning it of is for safety!!!
          gw.wait( 50 );                               // my gateway sometimes just can't handle to much child presents after each other
          gw.request( sensor + 1, V_LIGHT );           // Request current state from Home Automation controller. I just don't see any reason to store it in the EPROM
          gw.wait( 50 );                               // my gateway sometimes just can't handle to much child presents after each other
        }
      }
      
      
      void loop() {
        // Alway process incoming messages whenever possible
        gw.process();
      }
      
      void incomingMessage(const MyMessage &message) {
        if ( message.type==V_LIGHT ) { // We only expect one type of message from controller. But we better check anyway.
           int relayPin = RELAY_1 + message.sensor - 1;
           if ( message.sensor >= 1 && message.sensor <= NUMBER_OF_RELAYS ) { // make sure message is for a known pin. You wouldn't want to write to a pin that's being used for the radio.
             digitalWrite( relayPin, message.getBool() ? RELAY_ON : RELAY_OFF ); // Change relay state
      
             // Write some debug info
             Serial.print("Incoming change for sensor:");
             Serial.print(message.sensor);
             Serial.print( ", relay_pin: " );
             Serial.print( relayPin );
             Serial.print(", New status: ");
             Serial.println(message.getBool());
           }  
         } 
      }
      

      Sketch should work. Please post the serial output of this sketch.

      My first steps would be:

      1. Use the sketch I provided (should work, or I missed something).
      2. Disconnect RELAY from Arduino.
      3. Connect LEDs to the arduino with resistor (330 Ohm should be just fine)

      Test this. The reason I would remove the relay is to be sure there's no power issue. The arduino should be able to provide enough power for driving a simple LED.

      If this works you know that it's a hardware problem and from there on, you can investigate what the problem is.

      very very thank you , i will test this and i will comeback ❤

      posted in Troubleshooting
      Reza
      Reza
    • RE: help about error in serial monitor

      @hek
      thank you dear hek

      posted in Troubleshooting
      Reza
      Reza
    • Is the most of errors ( NACK , NO REPLAY , FAIL PDT) related to new library ?

      hi all
      for a time , i have some problem , i put several post about this and some people angry for my several post. i'm sorry about this , excuse me .
      for a time i read topics and i see some people have same problem. error similar to NACK , NO REPLY , FAIL PDT AND etc.
      i want share with you my tests and experiments .
      i want in end of this topic solve problem.
      i hope every body can help , share idea about this here .
      until now , i test some issue and dont solve problem .

      the problem is:
      after load sketch if distance was far (little) between node and gateway so first error is for cannot comunication node to gateway (some error about this is NO REPLY - FAIL PDT . . . ). also if connect , the connection is weak and most of commands is lost and dont back ack (some error about this is NACK) .

      i think this is related to new library . because before update(to v2.1) i use this device with this distance (didnt any change in locations of devices and nodes and gateway) . and i didnt have any problem. also i didnt use any repeater and for connection between nodes and gateway i had a connection directly. and all of command send with out any NACK . but now (after update) for 1/5 same distance i have errors .
      friends ! i use same device (hardware) and same sketch that use before update.

      my experiments :
      for this issue i test some hardware and software. but can not any help.
      for hardware i use some capacitor for radio (4.7uf - 100uf - 470uf)
      also use adapter radio (regulator 5 to 3.3)
      use 3 type of radio ( 2chip and 1 chip , 100m and 1km , with antena without antena)
      use some arduino nano ( ch340 and other models)
      use power switching 5v (1A - 2A - 10A)
      for gateway use raspberrypi3 and serial gateway (with capacitor and adapter and all type of radio)
      for sketch i use pa_level (for all models of radio) :
      min for gateway - min for nodes
      low for gateway - low for nodes
      high - high
      max- max
      the important issue is my devices and sketch work well before update library so i think this problem is related to update. so i want test again with library v2.0 or 1.5 and after this i report here.

      regards.

      posted in Troubleshooting
      Reza
      Reza
    • RE: [SOLVED] radio will connect to gateway with touch radio board with finger!!!

      dear @scalz perhaps Misunderstanding in my english! first i use capacitor ! 4.7u and 100u and 470u ! but was problem again and dont solve. so i replace capacitor with radio adapter ( AMS1117 regulator) but dont solve again. also i use radio adapter with capacitor (both) but problem again... so i did tired and continues with alone radio adapter with 50% NACK . so when i think found a solution ( delay(100);) so i change library and again load all relays and gateway. then i see radio just work with touch finger. i put a topic because this is strange for me and i want see there is a similar experiment between members!then i test again with capacitor instate of radio adapter... so i see work well ! now i have less 5% NACK . this is related to a delay(100) . again thank you

      posted in Troubleshooting
      Reza
      Reza
    • RE: communicate is good for first time for relays and sensors but after some days will be weak and some time stop working !

      @gohan
      for test first i change my regulator in controller and repeater,use LF33 instead of
      ams1117. but problem dont solve.now i put some relay near controller and connect directly to controller and i will test when there is problem and relay with repeater dont work, so relay that directly connect to controller have same problem or not !

      posted in Troubleshooting
      Reza
      Reza
    • RE: !TSM:FPAR:NO REPLY

      @ā¸Ŗā¸­āš€ā¸Ŗā¸ˇā¸­
      use a 100uf capacitor for radio and use

      #define MY_RF24_PA_LEVEL RF24_PA_HIGH
      

      for gateway and nodes.
      this is not excellent but work better with little error

      posted in Troubleshooting
      Reza
      Reza