Git Product home page Git Product logo

reedtripradio's People

Contributors

jason2866 avatar mightymos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

reedtripradio's Issues

(Resolved) How do i - compile without re-transmitting of reed and tamper status

I would like to use the unit as a Garage door status monitor.
Reed: - Contact closed (Door Closed) - Contact open (Door not Closed)
Trip: - Contact closed (Door Open) - Contact open (Door not Open)
But i don't require the re-transmit if the Reed or the Trip is open.
Where do i disable the re-transmit of the Reed and Trip status?

I have commented out line 139 and 130
// about ten minutes
//#define TAMPER_SLOT 38
//#define REED_SLOT 38
and from line 552 to 591 thinking that it will then not "Re-Transmit" the status

What else do i need to set / disable or am i doing it completely wrong?

GS-WDS07 permanent transmit

I just had an issue where one of my door sensors went into permanent transmit, see below.
It was permanently transmitting "Low Battery"
Battery voltage is 1.228Vdc
Replaced the battery with a new one, and it is working fine now.

It seems that the unit goes into a "Loop" once the battery low is triggered.

The problem is that it "killed" all our remotes.
Not able to open vehicle or garage doors.

The version i am using is 0.3.6

[063517] [RF] Received code: 0092C406 [063518] [RF] Action 0xA4 [063518] [RF] Received message 'C00102CD180092C406' [063518] [RF] Trying to match code 92C406 [063626] [MQTT] Sending homeassistant/RFBridge01/data => (136 bytes) (PID 3033) [063636] [MQTT] Publish ACK for PID 3033 [064350] [RF] Received code: 0092C406 [064351] [RF] Action 0xA4 [064351] [RF] Received message 'C00102CD180092C406' [064351] [RF] Trying to match code 92C406 [064459] [MQTT] Sending homeassistant/RFBridge01/data => (136 bytes) (PID 3034) [064474] [MQTT] Publish ACK for PID 3034 [065090] [RF] Received code: 0092C406 [065090] [RF] Action 0xA4 [065090] [RF] Received message 'C00102CD180092C406' [065091] [RF] Trying to match code 92C406 [065198] [MQTT] Sending homeassistant/RFBridge01/data => (136 bytes) (PID 3035) [065207] [MQTT] Publish ACK for PID 3035 [065636] [RF] Received code: 0092C406 [065636] [RF] Action 0xA4 [065637] [RF] Received message 'C00102CE180092C406' [065637] [RF] Trying to match code 92C406 [065744] [MQTT] Sending homeassistant/RFBridge01/data => (136 bytes) (PID 3036) [065754] [MQTT] Publish ACK for PID 3036 [066286] [RF] Received code: 0092C406 [066286] [RF] Action 0xA4 [066287] [RF] Received message 'C00102CD180092C406' [066287] [RF] Trying to match code 92C406 [066394] [MQTT] Sending homeassistant/RFBridge01/data => (136 bytes) (PID 3037) [066405] [MQTT] Publish ACK for PID 3037 [066832] [RF] Received code: 0092C406 [066833] [RF] Action 0xA4 [066833] [RF] Received message 'C00102CE180092C406' [066833] [RF] Trying to match code 92C406 [066941] [MQTT] Sending homeassistant/RFBridge01/data => (136 bytes) (PID 3038)

Report working/non-working receivers

Hello!

Very interesting Project!

A few comments from my side to the Sensors:
I have running 36 sensors. At every Window/Door one of them.

  • The Battery running time is about 1 year for the Sensor at the front door. Approx 1.5 years for all other sensors (Depending on the battery manufacturer? and number of openings)
  • I still have 6 spare sensors lying around. On this occasion I took a look at this.
    It is very important to remove the original batteries! All sensors have expired and some of the sensors have suffered severe damage

I also have several defective sensors. Some of these were already not working upon delivery. The reasons are different:

  • At 2 the antenna was missing
  • At 3 the magnetic switch is/was defective
  • 2 have an unknown defect (no reception)
  • 2 have bad RSSI values and have been replaced by me. No idea why.

In addition, I observed:

  • If the Battery is to low, the LED ist Flashing every 3-4 seconds
  • They have a built-in step-up converter. The voltage at the IC is always 3.3V. Regardless of the battery voltage.
    So I think it will unfortunately not be possible to transmit the battery voltage.

I use the sensors in connection with FHEM and a CUL.
All my sensors have the hardware revision DS-4 V1.0
I have a few sensors that send a slightly different ID.
Most send an ID:
1527x... e.g. 1527x3aef0
some send another:
01101F0100 or 010F0FF000
These also have different codes for
ON/OFF/DIMUP/DIMDOWN
Closed / Open / Tamper Contact / Battery
1527x... 1110 1010 0111 0110
01101F0100 1D DD F1 FD
I have no idea if it's just a different firmware.

I like the heartbeat idea. But too often the sensors shouldn't transmit, lest there be an overlap in the messages. I use too many sensors for that.

But it would be very interesting if you could use the sensors as a water leak sensor. The current of approx. 6ÂľA here is probably too high to detect water without additional hardware.

I will try to flash a sensor with this firmware one day. However, I still have a bit to learn about how to do this. So far I only have some experience with Ardunio, ESP, Attiny etc.
In this project, the "make" on my platforms brought different errors.

Many greetings
Bismosa

ESPHome - RF Bridge Component

Thank you so much for this project. It's really exactly what I was looking for.
I wanted to pass along some ESPHome info, because ESPHome is awesome and loads of fun to use.

Flashing ESPHome was very easy for my Sonoff RF Bridge R2 v2.2:

This will forward all RF captures to Home Assistant. Users can set up Home Assistant to map codes to binary sensors, do automations, alerts, etc.

Or:
ESPHome can decode these, but it requires a recompile + OTA to add new sensors.

Config:

substitutions:
  name: "rf-bridge"
  friendly_name: "RF Bridge"
  wifi_static_ip: "192.168.100.191"
  wifi_gateway: "192.168.100.1"
  api_encryption_key: "ptLta2XBJ/pXdWX4ZHWP1haYFCDy3c6bCZse4r3V3pY="

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  libraries:
    - iostream
    - regex
    - string.h

esp8266:
  board: esp01_1m

wifi:
  fast_connect: true
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: ${wifi_static_ip}
    gateway: ${wifi_gateway}
    subnet: 255.255.255.0
  ap:
    ssid: ${name} Fallback Hotspot
    password: !secret wifi_password

uart:
  tx_pin: 1
  rx_pin: 3
  baud_rate: 19200

rf_bridge:
  on_code_received:

    # static const unsigned char gBatteryLow  = 0x06;
    # static const unsigned char gTamperOpen  = 0x07;
    # static const unsigned char gTamperClose = 0x08;
    # static const unsigned char gBatteryOk   = 0x09;
    # static const unsigned char gReedOpen    = 0x0a;
    # static const unsigned char gReedClose   = 0x0e;

    - if:
        condition:
          or:
            - lambda: |-
                int trunc_code = int(data.code/256)*256;
                if (
                     trunc_code == 0x72FF00 ||
                     trunc_code == 0x11E500 ||
                     trunc_code == 0xEF7900 ||
                     trunc_code == 0x745400 ||
                     trunc_code == 0xEF3B00
                    )
                  return 1;
                else
                  return 0;
        then:
          - homeassistant.event:
              event: esphome.rf_code_received
              data:
                sync: !lambda 'return format_hex(data.sync);'
                low:  !lambda 'return format_hex(data.low);'
                high: !lambda 'return format_hex(data.high);'
                code: !lambda 'return format_hex(data.code);'
          # 001: Front Door (0x72FF)
          # 001: 0x72FF0A / 0x72FF0E
          - if:
              condition:
                lambda: 'return data.code == 0x72FF0A || data.code == 0x72FF0E;'
              then:
                - lambda: 'id(rf_sensor_001).publish_state(data.code == 0x72FF0A);'
          # 001_tamper: 0x72FF07 / 0x72FF08
          - if:
              condition:
                lambda: 'return data.code == 0x72FF07 || data.code == 0x72FF08;'
              then:
                - lambda: 'id(rf_sensor_001_tamper).publish_state(data.code == 0x72FF07);'
          # 001_battery: 0x72FF06 / 0x72FF09
          - if:
              condition:
                lambda: 'return data.code == 0x72FF06 || data.code == 0x72FF09;'
              then:
                - lambda: 'id(rf_sensor_001_battery).publish_state(data.code == 0x72FF06);'

          # 002: Garage Side Door
          # 002: 0x11E50A / 0x11E50E
          - if:
              condition:
                lambda: 'return data.code == 0x11E50A || data.code == 0x11E50E;'
              then:
                - lambda: 'id(rf_sensor_002).publish_state(data.code == 0x11E50A);'
          # 002_tamper: 0x11E507 / 0x11E508
          - if:
              condition:
                lambda: 'return data.code == 0x11E507 || data.code == 0x11E508;'
              then:
                - lambda: 'id(rf_sensor_002_tamper).publish_state(data.code == 0x11E507);'
          # 002_battery: 0x11E506 / 0x11E509
          - if:
              condition:
                lambda: 'return data.code == 0x11E506 || data.code == 0x11E509;'
              then:
                - lambda: 'id(rf_sensor_002_battery).publish_state(data.code == 0x11E506);'

          # 003: Dining Room Window
          # 003: 0xEF790A / 0xEF790E
          - if:
              condition:
                lambda: 'return data.code == 0xEF790A || data.code == 0xEF790E;'
              then:
                - lambda: 'id(rf_sensor_003).publish_state(data.code == 0xEF790A);'
          # 003_tamper: 0xEF7907 / 0xEF7908
          - if:
              condition:
                lambda: 'return data.code == 0xEF7907 || data.code == 0xEF7908;'
              then:
                - lambda: 'id(rf_sensor_003_tamper).publish_state(data.code == 0xEF7907);'
          # 003_battery: 0xEF7906 / 0xEF7909
          - if:
              condition:
                lambda: 'return data.code == 0xEF7906 || data.code == 0xEF7909;'
              then:
                - lambda: 'id(rf_sensor_003_battery).publish_state(data.code == 0xEF7906);'

          # 004: Back Door
          # 004: 0x74540A / 0x74540E
          - if:
              condition:
                lambda: 'return data.code == 0x74540A || data.code == 0x74540E;'
              then:
                - lambda: 'id(rf_sensor_004).publish_state(data.code == 0x74540A);'
          # 004_tamper: 0x745407 / 0x745408
          - if:
              condition:
                lambda: 'return data.code == 0x745407 || data.code == 0x745408;'
              then:
                - lambda: 'id(rf_sensor_004_tamper).publish_state(data.code == 0x745407);'
          # 004_battery: 0x745406 / 0x745409
          - if:
              condition:
                lambda: 'return data.code == 0x745406 || data.code == 0x745409;'
              then:
                - lambda: 'id(rf_sensor_004_battery).publish_state(data.code == 0x745406);'

          # 005: Family Room Window
          # 005: 0xEF3B0A / 0xEF3B0E
          - if:
              condition:
                lambda: 'return data.code == 0xEF3B0A || data.code == 0xEF3B0E;'
              then:
                - lambda: 'id(rf_sensor_005).publish_state(data.code == 0xEF3B0A);'
          # 005_tamper: 0xEF3B07 / 0xEF3B08
          - if:
              condition:
                lambda: 'return data.code == 0xEF3B07 || data.code == 0xEF3B08;'
              then:
                - lambda: 'id(rf_sensor_005_tamper).publish_state(data.code == 0xEF3B07);'
          # 005_battery: 0xEF3B06 / 0xEF3B09
          - if:
              condition:
                lambda: 'return data.code == 0xEF3B06 || data.code == 0xEF3B09;'
              then:
                - lambda: 'id(rf_sensor_005_battery).publish_state(data.code == 0xEF3B06);'

api:
  encryption:
    key: ${api_encryption_key}
  services:
    - service: send_rf_code
      variables:
        sync: int
        low: int
        high: int
        code: int
      then:
        - rf_bridge.send_code:
            sync: !lambda 'return sync;'
            low: !lambda 'return low;'
            high: !lambda 'return high;'
            code: !lambda 'return code;'
    - service: learn
      then:
        - rf_bridge.learn

logger:
  baud_rate: 0
  level: DEBUG

ota:

web_server:
  port: 80

button:                                
  - platform: restart
    name: "Restart"

binary_sensor:
  - platform: status
    name: "Status"
  
  - platform: template
    id: rf_sensor_001
    name: RF Sensor 001 Front Door
    device_class: opening
  - platform: template
    id: rf_sensor_001_tamper
    name: RF Sensor 001 Front Door Tamper
    device_class: tamper
  - platform: template
    id: rf_sensor_001_battery
    name: RF Sensor 001 Front Door Battery
    device_class: battery

  - platform: template
    id: rf_sensor_002
    name: RF Sensor 002 Garage Side Door
    device_class: opening
  - platform: template
    id: rf_sensor_002_tamper
    name: RF Sensor 002 Garage Side Door Tamper
    device_class: tamper
  - platform: template
    id: rf_sensor_002_battery
    name: RF Sensor 002 Garage Side Door Battery
    device_class: battery

  - platform: template
    id: rf_sensor_003
    name: RF Sensor 003 Dining Room Window
    device_class: opening
  - platform: template
    id: rf_sensor_003_tamper
    name: RF Sensor 003 Dining Room Window Tamper
    device_class: tamper
  - platform: template
    id: rf_sensor_003_battery
    name: RF Sensor 003 Dining Room Window Battery
    device_class: battery

  - platform: template
    id: rf_sensor_004
    name: RF Sensor 004 Back Door
    device_class: opening
  - platform: template
    id: rf_sensor_004_tamper
    name: RF Sensor 004 Back Door Tamper
    device_class: tamper
  - platform: template
    id: rf_sensor_004_battery
    name: RF Sensor 004 Back Door Battery
    device_class: battery

  - platform: template
    id: rf_sensor_005
    name: RF Sensor 005 Family Room Window
    device_class: opening
  - platform: template
    id: rf_sensor_005_tamper
    name: RF Sensor 005 Family Room Window Tamper
    device_class: tamper
  - platform: template
    id: rf_sensor_005_battery
    name: RF Sensor 005 Family Room Window Battery
    device_class: battery

status_led:
  pin:
    number: GPIO13
    inverted: yes

Flashing and compiling issues

Hello, thanks for your work on this - I have been using this sensor for a while so I am excited to try a new firmware on it...but...

When I try to flash the prebuilt binary the flash tool (STCGAL) stalls at waiting for MCU.

When I try to compile the binary and flash using make, the compile crashes out with a problem with a problem with patsubst in 1-mcu-settings.mk (line 114), after I updated the paths in the makefile so it could find things (before that it couldn't find anything). I can't see any obvious problems with the syntax.

I've tried on a linux machine and a windows machine with same result for the prebuilt flash. I've checked and I have the 104 variant chip on the sensor with the tamper detection, so it is the same as you have mentioned (same board rev based on the photos as well).

SDCC won't work on the linux machine for some reason, so my data point is only the windows machine for compiling. That could be a windows issue if you built the makefile etc. for linux, so perhaps not surprising. When I get a minute I'll try it on another linux box.

I've flashed lots of chips in my day, so Tx goes to Rx etc...equally, I have compiled a variety of things before.

Before I beat my head against the wall for a while longer, do you have any advice? Is there a library I might be missing or something?

Thanks in advance!

SDCC v4.3.0 requires parentheses for interrupt level numbers

I am having trouble compiling. I have the following error when I run the make command:

main.c:272: warning 283: function declarator with no prototype
main.c:259: warning 85: in function send_radio_packet unreferenced local variable : 'byteToSend'
main.c:425: syntax error: token -> '0' ; column 38
make: *** [build/main.rel] Error 1

I am using macOS.

Is there any known solution for this?

Thank you

2nd Flash impossible

Hello,

I have flash the version 0.3.3 with success. I am trying to flash 0.3.5 ( or any version now) and I am blocked on

Waiting for MCU, please cycle power:

I remove GND or VCC, but nothing appears, there is no data on serial port 1200b.
Any other way to enter flash mode ?
Pin are connected correctly and device stil working great. It works on a stock one.

Compilations Error Question

I'm not very experience in embed programming. I have the same door sensor and want to try customize my own device.
I started from creating a virtual box with debian 11 64bit machine then perform the following steps

apt-get install bison flex g++ libboost-dev texinfo cmake
wget https://jaist.dl.sourceforge.net/project/sdcc/sdcc/4.2.0/sdcc-src-4.2.0.tar.bz2
tar xjf sdcc-src-4.2.0.tar.bz2
cd sdcc-4.2.0
./configure --disable-pic14-port --disable-pic16-port
make && make install
sdcc -v
SDCC : mcs51/z80/z180/r2k/r2ka/r3ka/sm83/tlcs90/ez80_z80/z80n/ds390/TININative/ds400/hc08/s08/stm8/pdk13/pdk14/pdk15/mos6502 4.2.0 #13081 (Linux)
published under GNU General Public License (GPL)

cd 
git clone https://github.com/area-8051/stcgal-patched.git
git clone https://github.com/area-8051/uni-STC.git
cd uni-STC/demos/
git clone https://github.com/mightymos/ReedTripRadio.git
cd ReedTripRadio/
make
root@EmbededDevBox:~/uni-STC/demos/ReedTripRadio# make
sed: can't read s/^\(.*\.rel:.*\)/build\/\1/g: No such file or directory
make: *** No rule to make target 'build/dependencies.mk', needed by 'all'.  Stop.

I got error at the make command
If I issue make command again
I get many line of message from make below
sdcc -mmcs51 --model-small -DMCU_FREQ=24000000UL -I. -I/root/uni-STC/hal -I/root/uni-STC/include -I/root/uni-STC/drivers --opt-code-size -o build/delay.rel -c /root/uni-STC/hal/delay.c In file included from /root/uni-STC/hal/delay.c:31: /root/uni-STC/hal/delay.h:59:4: warning: #warning "CAUTION! delay1us() is *NOT* available in this MCU family + frequency" /root/uni-STC/hal/delay.h:60:4: warning: #warning "configuration, using delay10us() to emulate it, but with less accuracy." /root/uni-STC/hal/delay.h:61:4: warning: #warning "To remove this warning, define the SUPPRESS_delay1us_WARNING macro." sdcc -mmcs51 --model-small -DMCU_FREQ=24000000UL -I. -I/root/uni-STC/hal -I/root/uni-STC/include -I/root/uni-STC/drivers --opt-code-size -o build/main.rel -c main.c In file included from main.c:7: /root/uni-STC/hal/delay.h:59:4: warning: #warning "CAUTION! delay1us() is *NOT* available in this MCU family + frequency" /root/uni-STC/hal/delay.h:60:4: warning: #warning "configuration, using delay10us() to emulate it, but with less accuracy." /root/uni-STC/hal/delay.h:61:4: warning: #warning "To remove this warning, define the SUPPRESS_delay1us_WARNING macro." main.c:416: warning 85: in function send_radio_packet unreferenced local variable : 'byteToSend' sdcc -mmcs51 --model-small --iram-size 113 --xram-size 0 --stack-size 16 --code-size 1017 -o build/ReedTripRadio.hex build/delay.rel build/main.rel
in the same directory I got another directory named build with contains several files below

root@EmbededDevBox:~/uni-STC/demos/ReedTripRadio/build# ls
delay.asm  delay.rst        main.asm  main.rst           ReedTripRadio.lk
delay.lst  delay.sym        main.lst  main.sym           ReedTripRadio.map
delay.rel  dependencies.mk  main.rel  ReedTripRadio.hex  ReedTripRadio.mem

Could you tell me what I did wrong in my attempt to build this project.
do I need to SUPPRESS_delay1us_WARNING

Hopefully this is not a burden to you and thanks in advance for your help.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.