whiskerz007/proxmox_tuya-convert_container

bash: line 166: TEMPLATES: bad array subscript

Closed this issue · 7 comments

Hi Guys,
can anyone help?

root@proxmox:# bash -c "$(wget -qLO - https://github.com/whiskerz007/proxmox_tuya-convert_container/raw/master/create_container.sh)"
[INFO] Using 'local-lvm' for storage location.
[INFO] Using 'wlp0s20f3' wireless interface.
[INFO] Container ID is 108.
Updating LXC template list...
Downloading LXC template...
bash: line 166: TEMPLATES: bad array subscript
root@proxmox:
#

The issue is the Debian OS version, you can use this:

pveam update
pveam available -section system | grep debian-12

to check the os version and than create a fork so you can change the OSVERSION in the main script to your debian version

Hi Olivier, thank you for trying to help me.

that's the output:
pveam available -section system | grep debian-12
system debian-12-standard_12.7-1_amd64.tar.zst

i tried the following:

  1. I downloaded all the scripts
  2. In the create_container.sh i changed line 160 to OSVERSION=${OSTYPE}-12
  3. i uploaded the files to my proxmox
  4. I startet the create_container.sh
  5. This was the output:

root@proxmox:/proxmox_tuya-convert_container-master# ./create_container.sh
[INFO] Using 'local-lvm' for storage location.
[INFO] Using 'wlp0s20f3' wireless interface.
[INFO] Container ID is 108.
Updating LXC template list...
Downloading LXC template...
Creating LXC container...
Starting LXC container...
Customizing container OS...
Updating container OS...
Installing prerequisites...
Cloning tuya-convert...
Configuring tuya-convert...
./configure_tuya-convert.sh: line 12: iw: command not found
[ERROR:LXC] 127@68 Unknown failure occured.
[ERROR] 127@218 Unknown failure occured.
Logical volume "vm-108-disk-0" successfully removed.
root@proxmox:
/proxmox_tuya-convert_container-master#

Anymore ideas? :-(

You can use my fork https://github.com/oliviereising/proxmox_tuya-convert_container.git , the issues was that sudo and iw are not installed by default on a new container thus resulting in error when trying to update the WIFI device, after that it failed again on installing the tuya-convert repo because sudo is not installed / doesnt have the proper permissions.

Ok, the container is created. Thank You very much!
But there is a little confusion. What does ist mean? Deprecation? Should i do something? Please look below.

 _Installing collected packages: sslpsk, tornado, pycryptodomex, paho-mqtt
  _DEPRECATION: sslpsk is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559_
  Running setup.py install for sslpsk ... done
Successfully installed paho-mqtt-2.1.0 pycryptodomex-3.21.0 sslpsk-1.0.0 tornado-6.4.1
Customizing OS...
Cleanup...
[INFO] Successfully created tuya-convert LXC to 108._

Now i will order plugs again and try out my new tuya convert-container :-)

:-( No success. I think there is a prolem with tuya convert. I had the same errors on many different ways. I give up or do you have any ideas?

`Debian GNU/Linux 12 lxc-TuyaConvert tty1

  ******************************
    The tuya-convert files are
    shared using samba at
    10.0.1.50
  ******************************

  Login using the following credentials
    username: root
    password: tuya

lxc-TuyaConvert login: root
Password: 
Linux lxc-TuyaConvert 6.8.12-2-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.12-2 (2024-09-05T10:03Z) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Nov 16 19:55:26 CET 2024 on tty1
tuya-convert v2.4.6
Checking for network interface wlp0s20f3... Found.
Checking UDP port 53... Available.
Checking UDP port 67... Available.
Checking TCP port 80... Available.
Checking TCP port 443... Available.
Checking UDP port 6666... Available.
Checking UDP port 6667... Available.
Checking TCP port 1883... Available.
Checking TCP port 8886... Available.
======================================================
  Starting AP in a screen.
  Starting web server in a screen
  Starting Mosquitto in a screen
  Starting PSK frontend in a screen
  Starting Tuya Discovery in a screen

======================================================

IMPORTANT
1. Connect any other device (a smartphone or something) to the WIFI vtrust-flash
   This step is IMPORTANT otherwise the smartconfig may not work!
2. Put your IoT device in autoconfig/smartconfig/pairing mode (LED will blink fast). This is usually done by pressing and holding the primary button of the device
   Make sure nothing else is plugged into your IoT device while attempting to flash.
3. Press ENTER to continue


======================================================
Starting smart config pairing procedure
Waiting for the device to install the intermediate firmware
Traceback (most recent call last):
  File "/root/tuya-convert/scripts/./smartconfig/main.py", line 15, in <module>
    from smartconfig import smartconfig
  File "/root/tuya-convert/scripts/smartconfig/smartconfig.py", line 43, in <module>
    from multicast import multicast_head, encode_multicast_body
  File "/root/tuya-convert/scripts/smartconfig/multicast.py", line 12, in <module>
    from Cryptodome.Cipher import AES
ModuleNotFoundError: No module named 'Cryptodome'
........................................................................................................................
Timed out while waiting for the device to (re)connect
======================================================
Attempting to diagnose the issue...
No ESP82xx based devices connected according to your wifi log.
Here is a list of all the MAC addresses that connected:
6a:8f:ba:b6:ab:fa

If you see your IoT device in this list, it is not an ESP82xx based device.
Otherwise, another issue may be preventing it from connecting.
For additional information, check the *.log files inside the scripts folder.
Please include these logs when opening a new issue on our GitHub issue tracker.
======================================================
Do you want to try flashing another device? [y/N] n
======================================================
Cleaning up...
No screen session found.
No screen session found.
No screen session found.
Closing AP
Exiting...
tuya-convert exited with code:0

Debian GNU/Linux 12 lxc-TuyaConvert tty1

  ******************************
    The tuya-convert files are
    shared using samba at
    10.0.1.50
  ******************************

  Login using the following credentials
    username: root
    password: tuya

lxc-TuyaConvert login:

Hey there was still an error in the script. I patched that now, just recreate the container the same way as before

Hey Olivier! It works! YEEEEEAAAAAHHHH! I'm so happy now! Thank You so very much! I flashed 4 plugs successfully. Perfekt!
It was a long hard way to go :-)