Git Product home page Git Product logo

Comments (13)

horga83 avatar horga83 commented on June 21, 2024 3

I had to add "-P st15" as shown below for the flashing to work.

~/stcgal-patched/stcgal.py -p /dev/ttyUSB0 -P stc15 -l 1200 -b 1200 -t 24000 ReedTripRadio.ihx

Cheers

from reedtripradio.

mmotley999 avatar mmotley999 commented on June 21, 2024 1

Wanted to share that I have one of the newer Sonoff RF bridges (v2.2) and am using the hack you mentioned in your README. I'm running ESPHome, not Tasmota.

I can confirm that I'm seeing RCswitch protocol 1 codes on my Sonoff bridge with your firmware. I did have to increase the transmission count to 8 to increase the chance of a good code. I think 433mhz is busy/noisy in my area (or the hack causes some noise) as both the stock firmware and your firmware often send truncated codes along with good ones, and rare cases none would match (the hearbeat, which I enabled, will help keep things in sync but hopefully doesn't kill batteries).

from reedtripradio.

mightymos avatar mightymos commented on June 21, 2024

I use MSYS2 on Windows so I do not know if make will work with just windows command line or powershell.
That could be the issue as far as manually compiling.

I'm going to try to work on a firmware solution that makes flashing more reliable.
However this won't help with a first flash.
You basically just have to cycle power to the sensor by disconnecting/reconnecting 3.3V when stcgal says Waiting on MCU.

Otherwise a piece of hardware with diodes is likely required for more consistent flashing.
I may have to detail this as well to help.

But you can see an example that would hopefully work in sec 1.2.6.1 Application Circuit Diagram for ISP:
http://www.stcmcudata.com/datasheet/stc/STC-AD-PDF/STC15-English.pdf

from reedtripradio.

mightymos avatar mightymos commented on June 21, 2024

Sorry it's actually:
sec 1.2.6.2 Application Circuit Diagram for ISP using USB Chip PL-2303SA to convert Serial Port

from reedtripradio.

brandondb1 avatar brandondb1 commented on June 21, 2024

Hey, thanks for the feedback. I wired a microswitch inline to the ground side so I can click the power on and off and that made it much easier to cycle the power without disrupting the serial lines.

I never did get STCGAL to program anything - it only got as far as erasing the flash...which did work as the device was then dead. After that I get serial port error: read timeout

I had a lot more success with the STC ISP flasher (v6.91J). It detects the MCU every time (when I cycle the power with the microswitch), and claims to have programmed the device with the .ihx file (the activity log says all the right things and there us a little blue bar that progresses from zero to 100%). It did resurrect the one I killed with the STCGAL, so it is programming something...the light on the device again flashes as normal with a reed trip or tamper event. However, it doesn't seem to be transmitting anything. My Sonoff RF Bridges don't receive anything during these events. I don't have Portisch installed, so if the firmware is using another protocol, that would explain it, unless there is something else at play...do I need portisch to receive signals from this firmware?

Thanks again, and sorry to take up so much time!

from reedtripradio.

mightymos avatar mightymos commented on June 21, 2024

That's progress at least.
You need to select or input 24 MHz under Trim IRC -> Input IRC frequency.
I don't think Portisch is required.

Does setting clock frequency fix it?

EDIT: Stock timings and "protocol 1" timing from rc-switch/Portisch are now supported.
Main thing now is to test with various receivers and see if packets are reliably received or not.

from reedtripradio.

brandondb1 avatar brandondb1 commented on June 21, 2024

Hi, no unfortunately setting the freq to 24 didn't seem to make a difference. There are lots of settings in the STC program, so perhaps there is something else that needs to be set. I tried to copy the settings listed in STCGAL, but some don't have the same names or aren't specific enough to copy into the official STC program.

I tried STCGAL a bunch more times, and occasionally I get the incorrect frame start error but mostly the read timeout error.

It could be a current leak from the serial pins, but it is odd that the official STC program seems to work every time (even if it does not transmit, it connects and flashes, and consistently resurrects the device after STCGAL has erased it). You'd think it would have the same issues.

here is the STC official log from the last programming run:

Checking target MCU ...
MCU type: STC15W104
F/W version: 7.2.5T

Current H/W Option:
. Current system clock source is internal IRC oscillator
. Current frequency: 23.999MHz
. Wakeup Timer frequency: 36.850KHz
. Do not detect the level of P3.2 and P3.3 next download
. Power-on reset, use the extra power-on delay
. RESET pin behaves as IO pin
. Interrupt while detect a Low-Voltage
. Thresh voltage level of the built-in LVD : 2.66 V
. Inhibit EEPROM operation under Low-Voltage
. CPU-Core supply level : 3.02 V
. Hardware enable Watch-Dog-Timer when power-on reset
. Watch-Dog-Timer pre-scalar : 256
. Watch-Dog-Timer stop count in idle mode
. Program can modify the Watch-Dog-Timer scalar
. Do not erase user EEPROM area at next download
. Do not control 485 at next download
. Do not check user password next download
. TXD is independent IO
. TXD pin as quasi-bidirectional mode after reset
. P3.3 output HIGH level after reset
. Reference voltage: 1253 mV (Range: 1150~1320mV)
. Testing time: 2021-1-10

MCU type: STC15W104
F/W version: 7.2.5T

Adjusting frequency ... [0.765"]
Adjusted frequency: 24.011MHz (0.045%)

Re-handshaking ... Successful [0.125"]
Current Baudrate: 38400
Erasing MCU flash ... OK ! [0.407"]
Programming user code ... OK ! [1.625"]
Programming OPTIONS ... OK ! [0.063"]

H/W Option upgrade to:
. Current system clock source is internal IRC oscillator
. Current frequency: 24.011MHz
. Do not detect the level of P3.2 and P3.3 next download
. Power-on reset, use the general power-on delay
. RESET pin behaves as IO pin
. Interrupt while detect a Low-Voltage
. Thresh voltage level of the built-in LVD : 2.66 V
. Permit EEPROM operation under Low-Voltag
. CPU-Core supply level : 3.02 V
. Hardware enable Watch-Dog-Timer when power-on reset
. Watch-Dog-Timer pre-scalar : 256
. Watch-Dog-Timer stop count in idle mode
. Program can modify the Watch-Dog-Timer scalar
. Do not erase user EEPROM area at next download
. Do not control 485 at next download
. Do not check user password next download
. TXD is independent IO
. TXD pin as quasi-bidirectional mode after reset
. P3.3 output HIGH level after reset
. Reference voltage: 1253 mV (Range: 1150~1320mV)
. Testing time: 2021-1-10
MCU ID : F2A4C3A2000A02

MCU type: STC15W104
F/W version: 7.2.5T

. Set frequency: 24.000MHz
. Adjusted frequency: 24.011MHz
. Trim error: 0.045%

Complete !(2023-01-16 14:33:43)

from reedtripradio.

mightymos avatar mightymos commented on June 21, 2024

OK it's a little confusing because I am not sure how to reset to default settings in stc isp.
However we do not want watch dog timer enabled.
So setting should be:

Hardware do not enable Watch-Dog-Timer

from reedtripradio.

mightymos avatar mightymos commented on June 21, 2024

My output:

Checking target MCU ...
MCU type: STC15W104
F/W version: 7.2.5T

Current H/W Option:
. Current system clock source is internal IRC oscillator
. Current frequency: 24.134MHz
. Wakeup Timer frequency: 36.125KHz
. Do not detect the level of P3.2 and P3.3 next download
. Power-on reset, use the extra power-on delay
. RESET pin behaves as IO pin
. Reset while detect a Low-Voltage
. Thresh voltage level of the built-in LVD : 2.66 V
. Inhibit EEPROM operation under Low-Voltage
. CPU-Core supply level : 2.73 V
. Hardware do not enable Watch-Dog-Timer
. Watch-Dog-Timer pre-scalar : 256
. Watch-Dog-Timer stop count in idle mode
. Program can modify the Watch-Dog-Timer scalar
. Do not erase user EEPROM area at next download
. Do not control 485 at next download
. Do not check user password next download
. TXD is independent IO
. TXD pin as quasi-bidirectional mode after reset
. P3.3 output HIGH level after reset
. Reference voltage: 1256 mV (Range: 1150~1320mV)
. Testing time: 2022-5-24

MCU type: STC15W104
F/W version: 7.2.5T

Adjusting frequency ... [0.750"]
Adjusted frequency: 23.993MHz (-0.030%)

Re-handshaking ... Successful [0.172"]
Current Baudrate: 38400
Erasing MCU flash ... OK ! [0.344"]
Programming user code ... OK ! [0.750"]
Programming OPTIONS ... OK ! [0.062"]

H/W Option upgrade to:
. Current system clock source is internal IRC oscillator
. Current frequency: 23.993MHz
. Do not detect the level of P3.2 and P3.3 next download
. Power-on reset, use the extra power-on delay
. RESET pin behaves as IO pin
. Reset while detect a Low-Voltage
. Thresh voltage level of the built-in LVD : 2.66 V
. Inhibit EEPROM operation under Low-Voltage
. CPU-Core supply level : 2.27 V
. Hardware do not enable Watch-Dog-Timer
. Watch-Dog-Timer pre-scalar : 256
. Watch-Dog-Timer stop count in idle mode
. Program can modify the Watch-Dog-Timer scalar
. Do not erase user EEPROM area at next download
. Do not control 485 at next download
. Do not check user password next download
. TXD is independent IO
. TXD pin as quasi-bidirectional mode after reset
. P3.3 output HIGH level after reset
. Reference voltage: 1256 mV (Range: 1150~1320mV)
. Testing time: 2022-5-24
MCU ID : F2A4C4B41E16E0

MCU type: STC15W104
F/W version: 7.2.5T

. Set frequency: 24.000MHz
. Adjusted frequency: 23.993MHz
. Trim error: -0.030%

Complete !(2023-01-16 14:13:41)

from reedtripradio.

mightymos avatar mightymos commented on June 21, 2024

Also do you know if you have the Sonoff hardware version v1 or v2?

from reedtripradio.

brandondb1 avatar brandondb1 commented on June 21, 2024

Ah, ok. I have the r2v1 hardware, but I don't run Portisch. I tried it once but the raw format was more trouble than it was worth to try and decode for door and motion sensors in home assistant. I don't use it for anything else so there wasn't much to be gained (and the RF noise is constant with raw signals).

I was hoping with new firmware that the heartbeat could help indicate when a battery has died. I capture the battery low signals but in the stock firmware they are only sent once until the device is rebooted and the battery voltage crosses the threshold again (it's the crossing that triggers, not <).

Thanks again for the time you've spent on this - it's really great that you've figured it out and it will potentially be useful in other 433 devices that I'm sure use the same chip.

from reedtripradio.

mightymos avatar mightymos commented on June 21, 2024

Wanted to share that I have one of the newer Sonoff RF bridges (v2.2) and am using the hack you mentioned in your README. I'm running ESPHome, not Tasmota.

I can confirm that I'm seeing RCswitch protocol 1 codes on my Sonoff bridge with your firmware. I did have to increase the transmission count to 8 to increase the chance of a good code. I think 433mhz is busy/noisy in my area (or the hack causes some noise) as both the stock firmware and your firmware often send truncated codes along with good ones, and rare cases none would match (the hearbeat, which I enabled, will help keep things in sync but hopefully doesn't kill batteries).

@mmotley999 Would you be willing to test the "...StockTimings.ihx" release file with your bypassed receiver?
If it works (or does not) please let me know so I can update the readme table of seemingly compatible receivers?

from reedtripradio.

mightymos avatar mightymos commented on June 21, 2024

README has been updated to explain flashing via make and manually.
Stock and rc-switch "protocol 1" are supported and testing results with various receivers is also listed in readme when available.

from reedtripradio.

Related Issues (11)

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.