Skip to content

Instantly share code, notes, and snippets.

@zaxbux
Created September 12, 2023 02:29
Show Gist options
  • Save zaxbux/c7024a340ffd82ce7316dfc02f31c5e9 to your computer and use it in GitHub Desktop.
Save zaxbux/c7024a340ffd82ce7316dfc02f31c5e9 to your computer and use it in GitHub Desktop.
TubeZB CC2652P2 Ethernet/USB Coordinator ESPHome BLE Proxy
substitutions:
name: tubezb-cc2652p2-ethusb-2023
friendly_name: TubesZB and Bluetooth Proxy
esphome:
name: ${name}
friendly_name: ${friendly_name}
esp32:
board: esp32doit-devkit-v1
#board: esp-wrover-kit
framework:
#type: arduino # not recommended, higher memory usage
type: esp-idf
external_components:
- source: github://oxan/esphome-stream-server
#WT32-ETH01 Ethernet
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO0_IN
phy_addr: 1
power_pin: GPIO16
# Enable logging
logger:
level: DEBUG
# Enable Home Assistant API
api:
reboot_timeout: 0s
ota:
# not recommended, higher memory usage
# web_server:
# port: 80
script:
- id: fw_update_mode
then:
- switch.turn_on: zBSL
- delay: 1s
- switch.turn_on: zRST_gpio
- delay: 1s
- switch.turn_off: zRST_gpio
- logger.log: "Delaying ~10 seconds for cc2652p2 to settle"
- delay: 11s
- switch.turn_off: zBSL
- logger.log: "Please try update with cc2538-bsl tool now"
- logger.log: "cc-bsl usage: cc2538-bsl.py -p socket://ip-of-gw:6638 -evw firmware.hex"
switch:
- platform: gpio
pin: 33
id: zRST_gpio
inverted: yes
restore_mode: ALWAYS_OFF
- platform: gpio
pin: 32
name: "zBSL"
id: zBSL
inverted: yes
restore_mode: ALWAYS_OFF
- platform: template
name: "Prep the cc2652p2 for firmware update"
turn_on_action:
- script.execute: fw_update_mode
turn_off_action:
- button.press: zRST
button:
- platform: restart
name: "Restart the Device"
- platform: template
name: "Zigbee Module Reset"
id: zRST
on_press:
- switch.turn_on: zRST_gpio
- delay: 15ms
- switch.turn_off: zRST_gpio
uart:
- id: uart_bus
rx_pin: GPIO17
tx_pin: GPIO5
baud_rate: 115200
stream_server:
- uart_id: uart_bus
port: 6638 # optional, default is 6638
binary_sensor:
- platform: stream_server
connected:
name: Connected
mdns:
services:
- service: "_tubeszb"
protocol: "_tcp"
port: 6638
txt:
version: 1.0
name: TubesZB
radio_type: znp
baud_rate: 115200
data_flow_control: software
esp32_ble_tracker:
scan_parameters:
interval: 1100ms
window: 1100ms
active: true
bluetooth_proxy:
active: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment