#macOS - Parallels - Ubuntu - Docker setup issues

1 messages · Page 1 of 1 (latest)

idle scaffold
#

@torn hazel

Let's take a step back and see if things work in Ubuntu first. It should have Python 3.8+ pre-installed. Can you open a new shell and run:

virtualenv -p 3 venv
source venv/bin/activate
pip install git+https://github.com/zigpy/zigpy-cli
zigpy -vvv radio --baudrate 115200 ezsp /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220816155607-if00 info
#

You may need to run sudo apt install python-virtualenv or python-venv first, I forget the package name

#

Shut down both the HA and deCONZ containers first, just to make sure they won't interfere

torn hazel
#

both shut down.... installing python-venv

#

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python-virtualenv is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python-virtualenv' has no installation candidate
parallels@ubuntu-linux-20-04-desktop:~$ sudo apt install python-venv
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python-venv

idle scaffold
#

You may need to do sudo apt update first. If that doesn't work, try running python3 -m venv venv instead

torn hazel
#

ok, got venv installed

#

venv running

idle scaffold
#

If the pip install step fails, you may need to sudo apt install build-essential

#

And possibly python3-dev? I forget if Ubuntu pre-installs this stuff...

#

@torn hazel did it close?

torn hazel
#

ok, got the info, and crash and burn msg

idle scaffold
#

Can you upload a screenshot of it or the actual console output?

#

@torn hazel Your stick doesn't work in Ubuntu either

#

Next step: do you have Python installed in macOS?

torn hazel
#

will in a second.

idle scaffold
torn hazel
#

have python 3 loaded

idle scaffold
#

Those same commands you ran in Ubuntu should work in macOS

#

Shut off Parallels and give it a try there

#

The Sonoff stick will show up as /dev/cu.SLAB_USBtoUART I think

torn hazel
#
/dev/cu.Bluetooth-Incoming-Port        /dev/cu.usbserial-202208161556071
/dev/cu.usbmodemDE24332351        /dev/cu.wlan-debug```
idle scaffold
#

Probably the 2022 one

torn hazel
#

usbserial is sonoff

#

usbmodem is conbee II

#

getting errors trying to install zigpy stuff

#

something about missing xcrun. let me reinstall python with brew

idle scaffold
#

Oh, you need xcode's command line tools: xcode-select --install

torn hazel
#

they are installing with brew

#

I appreciate your time,greatly

idle scaffold
#

No worries. There's a root cause to your problems, somewhere, because macOS on its own works with the Conbee and with sticks similar to the Sonoff.

torn hazel
#

homebrew still installing

#

still going....

#

Successfully installed aiohttp-3.8.3 aiosignal-1.3.1 aiosqlite-0.18.0 async-timeout-4.0.2 attrs-22.2.0 bellows-0.34.5 cffi-1.15.1 charset-normalizer-2.1.1 click-8.1.3 click-log-0.4.0 coloredlogs-15.0.1 crccheck-1.3.0 cryptography-38.0.4 frozenlist-1.3.3 humanfriendly-10.0 idna-3.4 jsonschema-4.17.3 multidict-6.0.4 pure-pcapy3-1.0.1 pycparser-2.21 pyrsistent-0.19.3 pyserial-3.5 pyserial-asyncio-0.6 scapy-2.5.0 voluptuous-0.13.1 yarl-1.8.2 zigpy-0.52.3 zigpy-cli-0.0.1 zigpy-deconz-0.19.2 zigpy-znp-0.9.2

#

where did it install them?

idle scaffold
#

Within venv

#

When you activate the venv, you can use packages contained within it. If you don't need the venv anymore, you can delete it and they're all gone

torn hazel
#

boom! no errors in maco os cli

idle scaffold
#

So the info command ran fine?

#

Remove the --baudrate 115200 option and change the radio type from ezsp to deconz. The same info command should run with the Conbee

#

And try the same within the Ubuntu container

torn hazel
#

macos sees both successfully. starting parallels

idle scaffold
#

The only difference between the Conbee and the Sonoff stick is USB-serial chip used

torn hazel
#

sonoff seen in parallels

idle scaffold
#

I thought it didn't work within Ubuntu?

torn hazel
#

did now

idle scaffold
#

Then it should work in the HA Docker container

torn hazel
#

that[s my next step

#
Select the serial port for your Zigbee radio

Serial Device Path

/dev/ttyUSB1 - n/a, s/n: n/a

/dev/ttyUSB0 - n/a, s/n: n/a

/dev/ttyACM1 - SONOFF Zigbee 3.0 USB Dongle Plus V2, s/n: 20220816155607 - ITEAD

/dev/ttyACM0 - ConBee II, s/n: DE2433235 - dresden elektronik ingenieurtechnik GmbH

Enter Manuall```
#

trying ttyACM1

#

Unknown error has occurred.

idle scaffold
#

Alright, let's try one level deeper then 😆. No other containers running, correct?

#

From the Ubuntu environment, you should be able to run docker exec -it homeassistant /bin/bash to get into the HA Docker container

#

From there, pip install git+https://github.com/zigpy/zigpy-cli and try running the same commands to talk to the two radios

torn hazel
#

correct

#
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> cffi

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.```
idle scaffold
#

This is within the Docker container?

torn hazel
#

yes

idle scaffold
#

Within a venv or outside of one?

torn hazel
#

within

idle scaffold
#

Run deactivate to leave the venv

#

You can install zigpy-cli globally, it has no new dependencies

torn hazel
#
bash-5.1# zigpy -vvv radio --baudrate 115200 ezsp /dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220816155607-if00 info
2022-12-29 11:18:59.977 ubuntu-linux-20-04-desktop asyncio DEBUG Using selector: EpollSelector
2022-12-29 11:19:00.022 ubuntu-linux-20-04-desktop asyncio DEBUG Using selector: EpollSelector
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20220816155607-if00'

idle scaffold
#

You'll have to use the same path as you used with ZHA: /dev/ttyUSB* or /dev/ttyAMC*

torn hazel
#
bash-5.1# zigpy -vvv radio --baudrate 115200 ezsp /dev/ttyACM1 info
2022-12-29 11:20:28.822 ubuntu-linux-20-04-desktop asyncio DEBUG Using selector: EpollSelector
2022-12-29 11:20:28.848 ubuntu-linux-20-04-desktop asyncio DEBUG Using selector: EpollSelector
2022-12-29 11:20:28.849 ubuntu-linux-20-04-desktop bellows.ezsp DEBUG Resetting EZSP
2022-12-29 11:20:28.849 ubuntu-linux-20-04-desktop bellows.uart DEBUG Resetting ASH
2022-12-29 11:20:28.849 ubuntu-linux-20-04-desktop bellows.uart DEBUG Sending: b'1ac038bc7e'
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
2022-12-29 11:20:33.852 ubuntu-linux-20-04-desktop bellows.uart DEBUG Connection lost: None
2022-12-29 11:20:33.852 ubuntu-linux-20-04-desktop bellows.uart DEBUG Closed serial connection```
idle scaffold
#

So that doesn't work

#

What about the /dev/ttyUSB* link?

torn hazel
#

same results

idle scaffold
#

What about the Conbee?

torn hazel
#

works for conbee on usb1

#

2022-12-29 11:22:48.208 ubuntu-linux-20-04-desktop zigpy_deconz.api DEBUG Serial '/dev/ttyUSB1' connection lost unexpectedly: None

#

??

idle scaffold
#

That's normal

torn hazel
#

ok

idle scaffold
#

Ok, last thing to try: sudo apt-get purge modemmanager within Ubuntu and restart everything

torn hazel
#

not installed so not removed

idle scaffold
#

Well, I've got nothing 🤷‍♂️. It works in Ubuntu but doesn't work in the Docker container.

torn hazel
#

the conbee did, with zigpy

idle scaffold
#

Indeed

#

But there's no difference in the way they're passed through

#

Let me see if I can replicate this

torn hazel
#

HA Logs:

2022-12-29 11:33:16.969 DEBUG (MainThread) [zigpy_deconz.api] Serial '/dev/ttyACM0' connection lost unexpectedly: None```
idle scaffold
#

That line alone doesn't really mean anything

torn hazel
idle scaffold
#

No response from the Conbee

torn hazel
#

weird

#

and... if it were being seen by HA, zha would be an option

#

should I try z2m?

idle scaffold
#

If the Sonoff serial port doesn't work, it's either a Docker config issue, or a Parallels Ubuntu + Docker issue

#

Z2M does nothing different when it comes to communicating with the device

torn hazel
#

ok

#
1) ZHA was working with Conbee II
2) Zha stopped working around start of december (I thought stick had gone bad)
3) bought Sonoff to replace conbee II
4) could only get conbee II to work with deconz, after sonoff failed to work with ZHA and Z2M
#

ordered Sonoff Dec 2.

#

because conbee crapped out dec 1 (or so I thought)

idle scaffold
#

How did you install Docker into this Ubuntu system?

torn hazel
#

good question.

#

I don't recall, but everything is imported to the HA contaoiner, so I could blow it up and reinstaall

torn hazel
#

hey. z2M is starting up with it.

idle scaffold
#

The Sonoff stick?

torn hazel
#

conbee

idle scaffold
#

It seemed to work once within HA's container so 🤷‍♂️

#

A stick similar to the Sonoff one works just fine for me on macOS + Parallels + Ubuntu + Docker

#

So I suspect it's something with your specific setup

torn hazel
#

ok, I will look at that and see what I can do....

#

thanks again for all your help

torn hazel
#

one last question

#

seeing the mqtt messsages