Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uploader.py/sh info #15

Closed
sdetweil opened this issue May 8, 2023 · 13 comments
Closed

uploader.py/sh info #15

sdetweil opened this issue May 8, 2023 · 13 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@sdetweil
Copy link
Contributor

sdetweil commented May 8, 2023

can u provide any text of what is being accomplished?

I have the service swapped in now and can see its characteristics...

the bash script is looking two dirs up from tools folder, but on my mac under platformio its 4 levels up
and its looking at some json objects..

how is the hw/sw info used in the ESP on begin() compared to what on the sender app side?
what is the HW 'name' and value supposed to represent?

when platformio uploads the new code it reports
ESP32-D0WD-V3 (revision v3.0)

I have to port all the uploader to my IOS config app.
get info on images from some server api. then get the selected one (how tbd) and then send to the connected device

@vovagorodok vovagorodok self-assigned this May 9, 2023
@sdetweil
Copy link
Contributor Author

sdetweil commented May 9, 2023

i have been unable to get python dbus installed, used by bluezero... on mac or ubuntu

@sdetweil
Copy link
Contributor Author

sdetweil commented May 9, 2023

this made me update my 'app version' characteristic to retrieve the hw type as well. for image selection ...thx...

@vovagorodok
Copy link
Owner

vovagorodok commented May 9, 2023

the bash script is looking two dirs up from tools folder, but on my mac under platformio its 4 levels up
and its looking at some json objects..

Added more info in tools folder: https://github.com/vovagorodok/ArduinoBleOTA/blob/main/tools/README.md

how is the hw/sw info used in the ESP on begin() compared to what on the sender app side?
what is the HW 'name' and value supposed to represent?

Added more information about it: https://github.com/vovagorodok/ArduinoBleOTA/blob/main/doc/VERSIONING.md

when platformio uploads the new code it reports
ESP32-D0WD-V3 (revision v3.0)

It's not related to specific devkit hardware. HW name characteristic is used only for update possibilities. See VERSIONING.md

I have to port all the uploader to my IOS config app.
get info on images from some server api. then get the selected one (how tbd) and then send to the connected device

You can check how it implemented in https://github.com/vovagorodok/ble_ota_app. It helps to small developers attach their devices to update system (for free) just by adding new line to this app: https://github.com/vovagorodok/ble_ota_app/blob/main/doc/ADD_NEW_HARDWARE.md and not create their new app for updating (if they want of course). Application is ready and will be released soon in Android and iOS stores.

@vovagorodok
Copy link
Owner

i have been unable to get python dbus installed, used by bluezero... on mac or ubuntu

Hmm strange it should work only in linux because of DBus. Ubuntu contain systemd and dbus

@sdetweil
Copy link
Contributor Author

sdetweil commented May 9, 2023

says dbus not found...

not a python guy. all the instructions for solving fail to build some 'wheel'?

@sdetweil
Copy link
Contributor Author

sdetweil commented May 9, 2023

on the added Doc. got it.. I think I was expecting more checking against the info needed on begin().

thanks for app info.. not sure I can go that way as your service in not advertising unless my app sends a trigger thru my service's characteristics. (ie, your service is ONLY available JUST for a the actual upload)

app.. my app is written in Ionic, so there is a layer between my JS code and hardware access.. will see..

@vovagorodok
Copy link
Owner

says dbus not found...
not a python guy. all the instructions for solving fail to build some 'wheel'?

In Ubuntu I just install bluezero:

pip3 install bluezero

Please show me error log

@sdetweil
Copy link
Contributor Author

sdetweil commented May 9, 2023

ok dbus fixed... next

(base) sam@sams:~/ArduinoBleOTA/tools$ pip3 install bluezero
Collecting bluezero
  Using cached bluezero-0.7.1-py2.py3-none-any.whl (41 kB)
Installing collected packages: bluezero
Successfully installed bluezero-0.7.1
(base) sam@sams:~/ArduinoBleOTA/tools$ ./uploader.py
Traceback (most recent call last):
  File "./uploader.py", line 2, in <module>
    from bluezero import adapter
  File "/home/sam/anaconda3/lib/python3.7/site-packages/bluezero/adapter.py", line 10, in <module>
    from bluezero import async_tools
  File "/home/sam/anaconda3/lib/python3.7/site-packages/bluezero/async_tools.py", line 7, in <module>
    from gi.repository import GLib
ModuleNotFoundError: No module named 'gi'

uname -a
Linux sams 5.4.0-122-generic #138-Ubuntu SMP Wed Jun 22 15:00:31 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal

and trying to install gi

 pip3 install PyGObject  
Requirement already satisfied: PyGObject in /usr/lib/python3/dist-packages (3.36.0)
Collecting pycairo>=1.11.1
  Downloading pycairo-1.23.0.tar.gz (344 kB)
     |████████████████████████████████| 344 kB 4.5 MB/s 
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pycairo
  Building wheel for pycairo (PEP 517) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 /tmp/tmp6sj0_60m build_wheel /tmp/tmp6l7kr8mr
       cwd: /tmp/pip-install-gy39sq2h/pycairo
  Complete output (19 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-cpython-38
  creating build/lib.linux-x86_64-cpython-38/cairo
  copying cairo/__init__.py -> build/lib.linux-x86_64-cpython-38/cairo
  copying cairo/__init__.pyi -> build/lib.linux-x86_64-cpython-38/cairo
  copying cairo/py.typed -> build/lib.linux-x86_64-cpython-38/cairo
  running build_ext
  building 'cairo._cairo' extension
  creating build/temp.linux-x86_64-cpython-38
  creating build/temp.linux-x86_64-cpython-38/cairo
  x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DPYCAIRO_VERSION_MAJOR=1 -DPYCAIRO_VERSION_MINOR=23 -DPYCAIRO_VERSION_MICRO=0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/uuid -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/python3.8 -c cairo/bufferproxy.c -o build/temp.linux-x86_64-cpython-38/cairo/bufferproxy.o -Wall -Warray-bounds -Wcast-align -Wconversion -Wextra -Wformat=2 -Wformat-nonliteral -Wformat-security -Wimplicit-function-declaration -Winit-self -Winline -Wmissing-format-attribute -Wmissing-noreturn -Wnested-externs -Wold-style-definition -Wpacked -Wpointer-arith -Wreturn-type -Wshadow -Wsign-compare -Wstrict-aliasing -Wundef -Wunused-but-set-variable -Wswitch-default -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-command-line-argument -fno-strict-aliasing -fvisibility=hidden -std=c99
  cairo/bufferproxy.c:32:10: fatal error: Python.h: No such file or directory
     32 | #include <Python.h>
        |          ^~~~~~~~~~
  compilation terminated.
  error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pycairo
Failed to build pycairo
ERROR: Could not build wheels for pycairo which use PEP 517 and cannot be installed directly

@vovagorodok
Copy link
Owner

@sdetweil
Copy link
Contributor Author

sdetweil commented May 9, 2023

thx, that worked, but no change really

(base) sam@sams:~/ArduinoBleOTA/tools$ pip3 install PyGObject  
Requirement already satisfied: PyGObject in /usr/lib/python3/dist-packages (3.36.0)
Collecting pycairo>=1.11.1
  Using cached pycairo-1.23.0.tar.gz (344 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
    Preparing wheel metadata ... done
Building wheels for collected packages: pycairo
  Building wheel for pycairo (PEP 517) ... done
  Created wheel for pycairo: filename=pycairo-1.23.0-cp38-cp38-linux_x86_64.whl size=325280 sha256=ca20052e697bf5f14f4e8f5d6cfe9bad8700872eed7a71a9d088648c31980aaf
  Stored in directory: /home/sam/.cache/pip/wheels/d9/25/86/ba7950c33840b1fda7ab932c7c7172d77b994807c5fd35c3ea
Successfully built pycairo
Installing collected packages: pycairo
Successfully installed pycairo-1.23.0
(base) sam@sams:~/ArduinoBleOTA/tools$ ./uploader.py
Traceback (most recent call last):
  File "./uploader.py", line 2, in <module>
    from bluezero import adapter
  File "/home/sam/anaconda3/lib/python3.7/site-packages/bluezero/adapter.py", line 10, in <module>
    from bluezero import async_tools
  File "/home/sam/anaconda3/lib/python3.7/site-packages/bluezero/async_tools.py", line 7, in <module>
    from gi.repository import GLib
ModuleNotFoundError: No module named 'gi'

@vovagorodok
Copy link
Owner

vovagorodok commented May 9, 2023

https://stackoverflow.com/questions/71369726/no-module-named-gi

uploader.py i started from

#!/usr/bin/env python3

Maybe not the same instances.
Try python3 uploader.py instead ./uploader.py

@sdetweil
Copy link
Contributor Author

sdetweil commented May 9, 2023

no, missed link above.. which fixed gi issue..

SO now script runs.. onward!

thanks

@sdetweil
Copy link
Contributor Author

sdetweil commented May 9, 2023

closing now..

@sdetweil sdetweil closed this as completed May 9, 2023
@vovagorodok vovagorodok added the documentation Improvements or additions to documentation label May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants