cu-ecen-aeld / final-project-MehulCUB

final-project-MehulCUB created by GitHub Classroom
0 stars 1 forks source link

MQTT Setup for Subscriber on Raspberry Pi Yocto #6

Closed MehulCUB closed 2 years ago

MehulCUB commented 2 years ago

DoD

Blockers : https://github.com/cu-ecen-aeld/final-project-MehulCUB/issues/6#issuecomment-974558782 Resolved

MehulCUB commented 2 years ago

We are facing some issues with RPi-Distro/firmware-nonfree failining becasue of meta-raspberry Pi layer on this link :

link become unsupportive, previously it was working with successfully build.

Previously build was working till commit a0f6dd00c0c6c551436d9c1600e9a518a5d9ddbd as per shown in the https://github.com/cu-ecen-aeld/final-project-MehulCUB/issues/5#issue-1054457123

Facing Issue with rpi-distro failing as per error was as below

Page up
WARNING: URL: git://github.com/raspberrypi/linux.git;name=machine;branch=rpi-5.10.y uses git protocol which is no longer supported by github. Please change to ;protocol=https in the url.
WARNING: linux-raspberrypi-1_5.10.76+gitAUTOINC+e1979ceb17_3728690b4a-r0 do_fetch: URL: git://github.com/raspberrypi/linux.git;name=machine;branch=rpi-5.10.y uses git protocol which is no longer s
upported by github. Please change to ;protocol=https in the url.
WARNING: bluez-firmware-rpidistro-1.2-4+rpt8-r0 do_fetch: URL: git://github.com/RPi-Distro/bluez-firmware uses git 
protocol which is no longer supported by github. Please change to ;protocol=https in the url.
WARNING: bluez-firmware-rpidistro-1.2-4+rpt8-r0 do_fetch: URL: git://github.com/RPi-Distro/bluez-firmware does not 
set any branch parameter. The future default branch used by tools and repositories is uncertain and we will therefo
re soon require this is set in all git urls.
WARNING: bluez-firmware-rpidistro-1.2-4+rpt8-r0 do_unpack: URL: git://github.com/RPi-Distro/bluez-firmware uses git
 protocol which is no longer supported by github. Please change to ;protocol=https in the url.
WARNING: bluez-firmware-rpidistro-1.2-4+rpt8-r0 do_unpack: URL: git://github.com/RPi-Distro/bluez-firmware does not
 set any branch parameter. The future default branch used by tools and repositories is uncertain and we will theref
ore soon require this is set in all git urls.
WARNING: linux-firmware-rpidistro-20190114-1+rpt11-r0 do_fetch: URL: git://github.com/RPi-Distro/firmware-nonfree u
ses git protocol which is no longer supported by github. Please change to ;protocol=https in the url.
WARNING: linux-firmware-rpidistro-20190114-1+rpt11-r0 do_fetch: URL: git://github.com/RPi-Distro/firmware-nonfree d
oes not set any branch parameter. The future default branch used by tools and repositories is uncertain and we will
 therefore soon require this is set in all git urls.
WARNING: pi-bluetooth-0.1.17-r0 do_fetch: URL: git://github.com/RPi-Distro/pi-bluetooth uses git protocol which is 
no longer supported by github. Please change to ;protocol=https in the url.
WARNING: pi-bluetooth-0.1.17-r0 do_fetch: URL: git://github.com/RPi-Distro/pi-bluetooth does not set any branch par
ameter. The future default branch used by tools and repositories is uncertain and we will therefore soon require th
is is set in all git urls.
WARNING: linux-firmware-rpidistro-20190114-1+rpt11-r0 do_fetch: Failed to fetch URL git://github.com/RPi-Distro/fir
mware-nonfree, attempting MIRRORS if available
WARNING: linux-firmware-rpidistro-20190114-1+rpt11-r0 do_fetch: URL: git://github.com/RPi-Distro/firmware-nonfree;p
rotocol=https does not set any branch parameter. The future default branch used by tools and repositories is uncert
ain and we will therefore soon require this is set in all git urls.
WARNING: linux-firmware-rpidistro-20190114-1+rpt11-r0 do_fetch: URL: git://github.com/git/RPi-Distro/firmware-nonfr
ee;protocol=https does not set any branch parameter. The future default branch used by tools and repositories is un
certain and we will therefore soon require this is set in all git urls.
ERROR: linux-firmware-rpidistro-20190114-1+rpt11-r0 do_fetch: Fetcher failure: Unable to find revision 83938f78ca2d
5a0ffe0c223bb96d72ccc7b71ca5 in branch master even from upstream
ERROR: linux-firmware-rpidistro-20190114-1+rpt11-r0 do_fetch: Bitbake Fetcher Error: FetchError('Unable to fetch UR
L from any source.', 'git://github.com/RPi-Distro/firmware-nonfree')
ERROR: Logfile of failure stored in: /mnt/build-cache/aesd/myj/final-project-MehulCUB/build/tmp/work/all-poky-linux
/linux-firmware-rpidistro/20190114-1+rpt11-r0/temp/log.do_fetch.2110556
ERROR: Task (/mnt/build-cache/aesd/myj/final-project-MehulCUB/meta-raspberrypi/recipes-kernel/linux-firmware-rpidis
tro/linux-firmware-rpidistro_git.bb:do_fetch) failed with exit code '1'
WARNING: linux-raspberrypi-1_5.10.76+gitAUTOINC+e1979ceb17_3728690b4a-r0 do_fetch: URL: git://github.com/raspberryp
i/linux.git;name=machine;branch=rpi-5.10.y uses git protocol which is no longer supported by github. Please change 
to ;protocol=https in the url.
NOTE: Tasks Summary: Attempted 1484 tasks of which 0 didn't need to be rerun and 1 failed.
Summary: 1 task failed:
  /mnt/build-cache/aesd/myj/final-project-MehulCUB/meta-raspberrypi/recipes-kernel/linux-firmware-rpidistro/linux-f
irmware-rpidistro_git.bb:do_fetch
Summary: There were 19 WARNING messages shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.
MehulCUB commented 2 years ago

Resolved issue for meta-raspberry pi layer became incompatible after URL became unsupportive

We could resolve the issue by removing all layers - meta raspberry pi, meta-open embedded, and poky submodules.

We tried multiple times, then was a compatibility issue with a branch for the meta-raspberry pi layer(previously it was working, but as that branch became unsupportive for the meta-raspberry pi layer because some changes were made at the source URL, I removed all meta-layer submodules and added again with dun fell branch, it worked successfully.

bulld is working successfully as per commit : 1eb2c862ceabebe2cbc922c5a7f37370c0752be4

MehulCUB commented 2 years ago

image working successfully and ssh and wifi enabled as :

https://github.com/cu-ecen-aeld/final-project-MehulCUB/issues/7#issue-1059240515

MehulCUB commented 2 years ago

Added support on MQTT Raspberry Pi on Yocto for MQTT subscriber

as per commit bc51c3d22ef1d08f49fc1f8ded7399409ef88211

MehulCUB commented 2 years ago

Tested MQTT working using MQTT publisher and subscriber python scripts

Images

IMG-8629

MehulCUB commented 2 years ago

Added Support for MQTT Raspberry Pi and Python package

build script support for python package for MQTT

MehulCUB commented 2 years ago

MQTT based publisher-subscriber communication working successfully

Able to send string message and receive it on local host

MehulCUB commented 2 years ago

Testing MQTT setup working MQTT on yocto

Bjorn developed a python script for using python script for publisher and subscriber

code link support directory

MehulCUB commented 2 years ago

Publisher script link : https://github.com/cu-ecen-aeld/final-project-bjornhnelson/blob/master/source_code/pub.py

MehulCUB commented 2 years ago

Subscriber script link : https://github.com/cu-ecen-aeld/final-project-bjornhnelson/blob/master/source_code/sub.

MehulCUB commented 2 years ago

Working on MQTT communication Setup working using C library package

Adding Paho C client library for MQTT as per https://github.com/eclipse/paho.mqtt.c

Running sample publisher-subscriber MQTT sample code on raspberry PI publisher

sub

MehulCUB commented 2 years ago

Added c client package in for Yocto support

MehulCUB commented 2 years ago

MQTT client working for Yocto

We worked on Python scripts for MQTT, by adding paho-mqtt package for python.

as per commit

Please find client script https://github.com/cu-ecen-aeld/final-project-support-bjorn-mehul/tree/main/mqtt_scripts

MehulCUB commented 2 years ago

We can see captured images from both server and client. And also send the sensor reading to the client.

MehulCUB commented 2 years ago

Successfully Image transfer and BME sensor reading communication between server-client using MQTT communication.

showing data and image transfer working successfully on as per below image

one image is shown on ImageMagick is captured on yocto based rpi and another is captured on buildroot based RPI

IMG-8763

MehulCUB commented 2 years ago

Continuous sensor reading at every 1 second working on Yocto based RPi The data sent using MQTT to client. image_123986672 (2)

MehulCUB commented 2 years ago

.