Just started to update new page section for gateway 2.x configuration. It can be find in menu on right. It will describe basics terminology for OHS, new shell interface for OHS 2.x gateways and of course a web interface used to configure the functionality. Currently it is work in progress, but I will try to add all sections that are missing, and finish it as primary guide for new users.
OHS is open source based burglar alarm and automation platform. It can work as new alarm gateway, or it can replace your old alarm panel. OHS can use any wired 12V sensor, PIR, smoke or reed switch. It has Web interface that is used to set it up. OHS has GSM modem that is able to send SMS or page you. It has radio interface for environmental sensors. OHS is self-contained, it does not need any cloud service, only optional SMTP server for emails, or MQTT server to publish collected sensor data.
Sunday, September 6, 2020
Gateway 2.x configuration
Tuesday, August 25, 2020
DFU - Device Firmware Upgrade
Gateways 2.s have now a new user convenient way of upgrading firmware without any external programmer. As STM32F4xx devices include built in USB DfuSe bootloader, I was wanting to implement such functionality into OHS as well. Since software version 1.2 there is an option in shell interface to boot the device to dfu mode., and then upgrade the firmware directly via USB cable.
DFU tools:
dfu-util is a simple multi-platform command line tool that can upload binary data directly to flash.
List DFU ready devices via: dfu-util -l
Example output of gateway 2.x, most important is the 'alt=0, name="@Internal Flash ' descriptor that we gonna use:
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, path="3-6", alt=3, name="@Device Feature/0xFFFF0000/01*004 e", serial="336A34763437"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, path="3-6", alt=2, name="@OTP Memory /0x1FFF7800/01*512 e,01*016 e", serial="336A34763437"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, path="3-6", alt=1, name="@Option Bytes /0x1FFFC000/01*016 e/0x1FFEC000/01*016 e", serial="336A34763437"
Found DFU: [0483:df11] ver=2200, devnum=12, cfg=1, intf=0, path="3-6", alt=0, name="@Internal Flash /0x08000000/04*016Kg,01*064Kg,07*128Kg", serial="336A34763437"
Flash the firmware via: dfu-util -a 0 --dfuse-address 0x08000000 -D ch.bin
STM32CubeProgrammer is also multi-platform tool but with graphical user interface. One downside is that you need older Java version installed to run it, but once you have it it will work nicely.
DFU howto:
- Connect your laptop/PC via USB cable to gateway. Status LED on gateway should change to short rapid flashes.
- Open any terminal emulation program like Putty and open serial connection to new enumerated USB device. On Linux it will be ACM0.
- In the terminal issue command 'boot dfu'.
- The gateway should close the USB connection, terminal will exit, or close, and the status LED will stop blinking.
- New USB device should be enumerated as 'STMicroelectronics STM Device in DFU Mode'
- Use any of DFU tool to list, connect and to download(in terms of to download a file to a DfuSe device) firmware into gateway.
- Reset the gateway via onboard reset button.
Saturday, August 22, 2020
Skeches for nodes compatible with OHS 2.x gateway
Recently I have pushed to GitHub new example sketches for the Arduino like remote nodes. These include software modifications, that are needed for the changes made in gateway 2.x software. Hardware part of nodes is still the same for both wired(RS485) and radio(RFM69) nodes.
Changes include:
- Periodical ping to gateway. OHS 2.x gateway require a ping command from every registered node at lest one in an hour, or it is removed from node list.
- Arm home. This new functionality is added to authentication mechanism on node, precisely to iButton routine. It works as usual for arm away, that is a quick touch of iButton arms away or disarms the group. When arm home state is required, user needs hold the iButton in probe for more then 1 second. Disarm is same as for arm away, a quick touch only is enough.
- Authentication key is sent to gateway, and OK / Not OK sound is result of gateway accepting the packet with key. This does not mean that the key is valid and accepted, only that the gateway has received the key. On old node software, the OK / Not OK sound was result of iButton probe reading the iButton correctly or not.
- New method for CRC signature for RS485 packets.
Repositories with software for nodes compatible with OHS 2.x gateway has name starting with: OHS_2-node
I will add new node examples as I build them.
Wednesday, July 8, 2020
OHS 2.0.4 - final version
Monday, June 8, 2020
OHS 2.0.4
- STM32F407 with 1GB of flash and 128KB + 64KB CCM of RAM, running at 168MHz.
- LAN8720A Ethernet PHY with 10/100Mbit.
- Two step power supply with 12V to 3V8 switching and 3V8 to 3V3 LDO.
- Battery for RTC CR2032. STM32F407 has on-board RTC.
- 10 analog (balanced) inputs for PIR, smoke, ...
- 4G SIM7600x module
- Radio module for RFM69HCW, or alternatively RFM95.
- 128KB SPI FRAM.
- RS485 for wired connections.
- 2 relays for sirens.
- 1 tamper zone for enclosure.
- Micro USB port.
- ST-LINK V2 port.
- 3 LEDs.
FRAM size has doubled for the reason to store some larger data needed conveniently. First half (64KB) is used as before to keep 4096 log entries for gateway logger. Second half will be available to several new functionalities I plan to add to gateway software. I was also tmepted to add a uSD card, but it is easier to store data on synchronous SPI FRAM, then to access uSD with file system that can be damaged or not present. Not to speak about wiring.
Also there is now a shotky diode, to add polarity protection to RTC battery.
Sunday, April 19, 2020
OHS logo
It will part of login screen, and 404 page. There is still plenty of storage on MCU flash (my STM32F407 has 1MB).onclick="en()" and
onclick="dis()"
to the master element. This master that triggers other elements property enabled or disabled by defining array of affected ids, such as:var x=document.querySelectorAll(\"#xx\");
var y=document.querySelectorAll(\"#a1,#a0\");
Wednesday, February 5, 2020
Moving forward with OHS2
- RS485 with new library for Arduino. Sending command and messages with ACKs. All the bits travel back and forth nicely and all timing look good on logic analyzer.
- GSM module work well wit accompanied new library for SMT32.
- Logging to FRAM.
- Relays are fine.
- Battery backup storage in SRAM is fine along with ruties.
- RTC, although there is now only UTC.
- HTTPD is working with static and dynamic html pages and and also POST is functional. Web server now includes pages for system info, zones, groups, nodes, users, keys and log.
If someone is interested all the source is in GitHub, and also any contribution is welcome.
