Jump to content

NLCbanner2024.jpg.2478be509670e60c2d6efd04834b8b47.jpg

Gina

Beyond the Event Horizon
  • Posts

    45,326
  • Joined

  • Last visited

  • Days Won

    120

Posts posted by Gina

  1. So far so good but I shall only feel I have it working when I have a separate client SBC talking to a client on the RPi or better still on something else.  I have another BME280 which I can put on some stripboard with one of the ESP32s and program to read the indoor temperature, humidity and atmospheric pressure and send it to the broker.  Then I can subscribe to new topics and send data.  That way I can try out the MQTT system without venturing out to the obsy in a deluge and also leave the sensors working for real use.

  2. I've GOT IT!! 😀

    Each command has to be on a separate SSH connection to the broker.  The first Terminal is just sitting there waiting for messages from clients.  When another terminal is opened and SSH'd to the broker subscribing to "test" and sending the message "Hello", then "Hello" appears in the first Terminal.

    pi@MQTTBrokerGina:~ $ mosquitto_sub -h localhost -t “test”
    
    “Hello”

    The MQTT system is working albeit with broker and clients on the same machine (RPi).  😀

  3. Tried rebooting - not solved it though.

    pi@MQTTBrokerGina:~ $ sudo reboot
    Connection to mqttbrokergina closed by remote host.
    Connection to mqttbrokergina closed.
    gina@Mint-Desktop ~ $ ssh pi@MQTTBrokerGina
    pi@mqttbrokergina's password: 
    Linux MQTTBrokerGina 5.4.51+ #1333 Mon Aug 10 16:38:02 BST 2020 armv6l
    
    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: Fri Aug 14 17:45:07 2020 from 192.168.1.79
    pi@MQTTBrokerGina:~ $ mosquitto_sub -h localhost -t “test”
    

    And there it sits doing nothing!  Evidently I'm not understanding this.  Can someone please tell me what I'm doing wrong?

  4. OK...  Running this sequence :-

    Quote

    1.     Starting with a fresh installation of Raspbian Buster Lite (burned here with Balena Etcher), enter sudo apt update then sudo apt upgrade in the command line to make sure you’ve got the latest and greatest running on your system.

    2.     Add the open source MQTT broker Mosquitto, along with Mosquitto client software on the Pi with sudo apt-get install mosquitto mosquitto-clients.

    3.     The new host address will be the IP address of the Pi, which is available by typing ifconfig. Installation will start the broker and allow it to start on boot. The mosquitto-clients portion of the install allows you to run a client on the machine as well as a broker.

    4.     In the Pi terminal, subscribe to the test topic with the command mosquitto_sub -h localhost -t “test”. This sends a subscription message to the MQTT broker running on the same system and lets it listen to any messages sent to this topic.

    Sections 1. to 3. completed.  In section 3. ifconfig confirms the IP address as correct.  In section 4. I copied the command into the Terminal but nothing happened.  Does the RPi need rebooting or am I completely misunderstanding this?

  5. That was it - I'm in 😀

    gina@Mint-Desktop ~ $ ssh pi@MQTTBrokerGina
    The authenticity of host 'mqttbrokergina (192.168.1.250)' can't be established.
    ECDSA key fingerprint is SHA256:eH9cpckOI0MiUwVEkp18LQ17PoYs0DoJtoLHcePf5yg.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'mqttbrokergina' (ECDSA) to the list of known hosts.
    pi@mqttbrokergina's password: 
    Linux MQTTBrokerGina 4.19.118+ #1311 Mon Apr 27 14:16:15 BST 2020 armv6l
    
    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: Fri Aug 14 16:38:52 2020 from 192.168.1.79
    pi@MQTTBrokerGina:~ $ 

     

  6. Not surprisingly, I think I've done something wrong in changing host name and password.  I decided on a host name of MQTT_Broker_Gina though this system seems to ignore case unlike most Linux systems.

    gina@Mint-Desktop ~ $ ssh pi@raspberrypi
    The authenticity of host 'raspberrypi (192.168.1.250)' can't be established.
    ECDSA key fingerprint is SHA256:eH9cpckOI0MiUwVEkp18LQ17PoYs0DoJtoLHcePf5yg.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added 'raspberrypi' (ECDSA) to the list of known hosts.
    pi@raspberrypi's password: 
    Linux raspberrypi 4.19.118+ #1311 Mon Apr 27 14:16:15 BST 2020 armv6l
    
    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.
    
    SSH is enabled and the default password for the 'pi' user has not been changed.
    This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.
    
    pi@raspberrypi:~ $ sudo raspi-config
    New password: 
    Retype new password: 
    passwd: password updated successfully
    
    Welcome to fdisk (util-linux 2.33.1).
    Changes will remain in memory only, until you decide to write them.
    Be careful before using the write command.
    
    
    Command (m for help): Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x55d719e5
    
    Device         Boot  Start      End  Sectors  Size Id Type
    /dev/mmcblk0p1        8192   532479   524288  256M  c W95 FAT32 (LBA)
    /dev/mmcblk0p2      532480 31116287 30583808 14.6G 83 Linux
    
    Command (m for help): Partition number (1,2, default 2): 
    Partition 2 has been deleted.
    
    Command (m for help): Partition type
       p   primary (1 primary, 0 extended, 3 free)
       e   extended (container for logical partitions)
    Select (default p): Partition number (2-4, default 2): First sector (2048-31116287, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (532480-31116287, default 31116287): 
    Created a new partition 2 of type 'Linux' and of size 14.6 GiB.
    Partition #2 contains a ext4 signature.
    
    Command (m for help): 
    Disk /dev/mmcblk0: 14.9 GiB, 15931539456 bytes, 31116288 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x55d719e5
    
    Device         Boot  Start      End  Sectors  Size Id Type
    /dev/mmcblk0p1        8192   532479   524288  256M  c W95 FAT32 (LBA)
    /dev/mmcblk0p2      532480 31116287 30583808 14.6G 83 Linux
    
    Command (m for help): The partition table has been altered.
    Syncing disks.
    
    Connection to raspberrypi closed by remote host.
    Connection to raspberrypi closed.
    gina@Mint-Desktop ~ $ ssh pi@raspberrypi
    ssh: Could not resolve hostname raspberrypi: Name or service not known
    gina@Mint-Desktop ~ $ ssh pi@MQTT_Broker_Gina
    ssh: Could not resolve hostname mqtt_broker_gina: Name or service not known
    gina@Mint-Desktop ~ $ 

     

  7. I certainly could though what I have in mind is a bit different.  I want temperature, humidity, wind speed, wind direction, rainfall, rain status, cloud status, etc. in addition to pressure and its trends.  Trouble is lack of free wall space.  The space above the fireplace has a giant clock with 3ft dial and many of my watercolour paintings plus router and WiFi AP.  East wall also has paintings and my moon dial clock plus a large bookshelf and air-con unit.  And a window, vintage barometer etc.

    • Haha 1
  8. Got as far as password again.

    gina@Mint-Desktop ~ $ ssh 192.168.1.250
    The authenticity of host '192.168.1.250 (192.168.1.250)' can't be established.
    ECDSA key fingerprint is SHA256:lEMA9QPPY5y8I57L7qlLbXpK95DZXF8hlbdZJJPvtd0.
    Are you sure you want to continue connecting (yes/no)? yes
    Warning: Permanently added '192.168.1.250' (ECDSA) to the list of known hosts.
    gina@192.168.1.250's password: 
    Permission denied, please try again.
    gina@192.168.1.250's password: 
    Permission denied, please try again.
    gina@192.168.1.250's password: 

    Where is the user password stored?  Can I change it by editing a file?  Or do I have to start again and use the default PW "raspberry".  Neither that or the one I set up now work.

  9. Put empty file SSH into boot directory and made wpa_supplicant.conf file with the info in it.

    gina@Mint-Desktop / $ cd media
    gina@Mint-Desktop /media $ ls
    gina
    gina@Mint-Desktop /media $ cd gina
    gina@Mint-Desktop /media/gina $ ls
    3630-3533  512-NTFS-1  512-NTFS-2  6363-3732  boot  rootfs  ssdata2
    gina@Mint-Desktop /media/gina $ cd boot
    gina@Mint-Desktop /media/gina/boot $ ls
    bcm2708-rpi-b.dtb         COPYING.linux  LICENCE.broadcom
    bcm2708-rpi-b-plus.dtb    fixup4cd.dat   overlays
    bcm2708-rpi-cm.dtb        fixup4.dat     ssh
    bcm2708-rpi-zero.dtb      fixup4db.dat   start4cd.elf
    bcm2708-rpi-zero-w.dtb    fixup4x.dat    start4db.elf
    bcm2709-rpi-2-b.dtb       fixup_cd.dat   start4.elf
    bcm2710-rpi-2-b.dtb       fixup.dat      start4x.elf
    bcm2710-rpi-3-b.dtb       fixup_db.dat   start_cd.elf
    bcm2710-rpi-3-b-plus.dtb  fixup_x.dat    start_db.elf
    bcm2710-rpi-cm3.dtb       issue.txt      start.elf
    bcm2711-rpi-4-b.dtb       kernel7.img    start_x.elf
    bootcode.bin              kernel7l.img   wpa_supplicant.conf
    cmdline.txt               kernel8.img
    config.txt                kernel.img
    gina@Mint-Desktop /media/gina/boot $ 

    Now to see if it works.  ie. if I can SSH into the RPi Zero.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.