Hilscher Community Forum
Apt-get related issue - Printable Version

+- Hilscher Community Forum (https://forum.hilscher.com)
+-- Forum: netFIELD Connect - Cloud managed Docker based Industrial Raspberry Pi 3 (https://forum.hilscher.com/forum-23.html)
+--- Forum: Software (https://forum.hilscher.com/forum-25.html)
+--- Thread: Apt-get related issue (/thread-794.html)



Apt-get related issue - DSongra - January-3rd-2022

Hello Armin,

Hope you are doing good.

Happy New year!

I am working on the NetFILED (version 2.2.0.0) Gateway for the MQTT application, I am stuck while configuring, I just wanted to know can I use the apt-get command in the NetFILED device without any issue or anything else I have to use?

I am referring below link for configuration -
https://mntolia.com/installing-mosquitto-mqtt-broker-on-ubuntu-debian-and-windows/


Br,
Devendra Songra


RE: Apt-get related issue - Armin@netPI - January-3rd-2022

netFIELD Connect device is a secure device with Hilscher netFIELD OS. Since this is a proprietary Hilscher made OS there is no official "apt" repository available which you could use like with official and public Linux Ubuntu distributions or Debian distribitions.

So when you open the Terminal in netFIELD Connect and try to call "apt update" ... it will fail always. But there is not such an "apt update" necessary with netFIELD Connect ... since netFIELD Connect is Docker based and all extension software needs to be installed via Docker containers and not - as you tried is now - via direct command line and packet installatons into main netFIELD OS trunk. So your try this is the wrong method how to add software.

To install additional software into ALL Hilscher netFIELD Gateways/and also netPI you have to install the software as Docker container. Installation via Docker containers is one of the bid advantages of Hilscher Gateway. By docker it is secured by design since noone can install additional packages with "apt" command into the main Linux.

Thx
Armin


RE: Apt-get related issue - Armin@netPI - January-3rd-2022

The very official Docker container of Mosquitto is this one here: https://hub.docker.com/_/eclipse-mosquitto


RE: Apt-get related issue - Armin@netPI - January-3rd-2022

Also see this post of another user sucessfully installed mosquitto container on Hilscher gateway: https://forum.hilscher.com/thread-269.html


RE: Apt-get related issue - DSongra - January-3rd-2022

Hello Armin,

I have read and performed the same process, but still, I am getting a connecting messages in node-red. 

attached mosquito log screenshot.

 
Br,
Devendra


RE: Apt-get related issue - Armin@netPI - January-3rd-2022

Well you are running into the same issue as the user Tad in this post https://forum.hilscher.com/thread-269.html.

I see in your log file that mosquitto be default is using a default mosquitto.conf file. But in this default mosquitto.conf file "anonymus logins" as Node-Red is performing it is disabled by default as explained in the very official mosquitto container documentation here https://mosquitto.org/documentation/migrating-to-2-0/

So either
a.) you create your own corrected mosquitto.conf file and map it into the container during container start
b.) you post edit the default mosquitto.conf file now in your started container manually using netPI container console mode and edit the file in the container's folder /mosquitto/mosquitto.conf with a text ediutor like "vi"

In both cases a.) and b.) the *.conf file has to contain the two lines 


Code:
listener 1883
allow_anonymous true

After editing the *.conf file restart the container and your mosquitto container is running find and accept anonymous logins of Node-RED.


RE: Apt-get related issue - DSongra - January-3rd-2022

Dear Armin,

This I have already perform. And then restarted the container.

"listener 1883

allow_anonymous true"

please find attached Screenshot.


RE: Apt-get related issue - Armin@netPI - January-3rd-2022

The latest container of today starts the mosquitto in the version V2.0.14. If you want to create you personal and own mosquitto.conf file from the default file, then get a copy of it from the official mosquitto's source code repository from here https://github.com/eclipse/mosquitto/blob/v2.0.14/mosquitto.conf and then edit the file and add the two missing lines

Then copy (WinSCP for example) your edited file to your netFIELD Compact gateway to the folder e.g. /home/admin/ and then start the container again with

Code:
docker run -d -it -p 1883:1883 -p 9001:9001 --name mosquitto -v /home/admin/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto

This command above will map your personal mosquitto.conf file into the new container during startup.


RE: Apt-get related issue - DSongra - January-3rd-2022

Dear Armin,
 
Thanks for your support, after manually adding edited mosquitto.conf file copy to /home/admin directory using WinSCP software of NetFILED gateway, it work properly for me. attached screenshot for reference.

Br,
Devendra


RE: Apt-get related issue - Armin@netPI - January-3rd-2022

Yes now it is perfect. Thx for your positive reply.