External access to eGeoffrey



  • Instead of going further in "My general sensor system" I thought it appropriate to start a new topic.

    When everything is working, I will crate another Howto to describe the way to do it.

    For now here is the beginning of the logs egoffrey-bridge listing

    pi@raspberrypi:~/egeoffrey $ sudo egeoffrey-cli logs egeoffrey-bridge
    Attaching to egeoffrey_egeoffrey-bridge_1
    egeoffrey-bridge_1 | Generating configuration file...
    egeoffrey-bridge_1 | Starting moquitto...
    egeoffrey-bridge_1 | 1593410212: Warning: Bridge egeoffrey-gateway using insecure mode.
    egeoffrey-bridge_1 | 1593410212: mosquitto version 1.6.9 starting
    egeoffrey-bridge_1 | 1593410212: Config loaded from /mosquitto/config/mosquitto.conf.
    egeoffrey-bridge_1 | 1593410212: Opening ipv4 listen socket on port 1883.
    egeoffrey-bridge_1 | 1593410212: Opening ipv6 listen socket on port 1883.
    egeoffrey-bridge_1 | 1593410212: Opening ipv4 listen socket on port 8883.
    egeoffrey-bridge_1 | 1593410212: Opening ipv6 listen socket on port 8883.
    egeoffrey-bridge_1 | 1593410212: Opening websockets listen socket on port 443.
    egeoffrey-bridge_1 | 1593410213: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593410213: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593410213: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593410219: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593410219: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593410219: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593410225: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593410225: Connection Refused: not authorised



  • @eporocrail thanks, couple of things to try. First of all let's see if you can authenticate against the broker:

    mosquitto_sub -h gateway.egeoffrey.com -u <your_house_name> -P '<your_password>' -t '#'
    

    if you don't get any error message, it is connecting just fine.

    Then if you can copy and paste or attach the file data/bridge/config/mosquitto.conf would be great (ensure to redact your password from there!).
    Thanks



  • @user2684

    ellard$ mosquitto_sub -h gateway.egeoffrey.com -u boomhut -P 'xxxx' -t '#'
    Connection error: Connection Refused: not authorised.
    ellards-MacBook-1:~ ellard$

    GNU nano 3.2 mosquitto.conf

    connection egeoffrey-gateway
    address gateway.egeoffrey.com:8883
    remote_clientid egeoffrey-boomhut-system-bridge
    remote_username boomhut
    remote_password xxxxxx
    bridge_capath /etc/ssl/certs
    #bridge_cafile /mosquitto/config/certs/ca.crt
    #bridge_certfile /mosquitto/config/certs/server.crt
    #bridge_keyfile /mosquitto/config/certs/server.key
    bridge_insecure true
    local_username boomhut
    local_password xxxxxx
    cleansession false
    try_private true
    topic egeoffrey/# out 2
    topic egeoffrey/# in 0
    notifications_local_only true
    bridge_protocol_version mqttv311



  • @eporocrail ok my bad, the mosquitto_sub should be working now. The mosquitto.conf file seems correct apart from "local_password xxxxxx" which should be commented out.



  • @user2684
    mosquito is OK.

    Stopped and started eGeoffrey again.

    pi@raspberrypi:~/egeoffrey $ sudo egeoffrey-cli logs egeoffrey-bridge
    Attaching to egeoffrey_egeoffrey-bridge_1
    egeoffrey-bridge_1 | Generating configuration file...
    egeoffrey-bridge_1 | Starting moquitto...
    egeoffrey-bridge_1 | 1593429692: Warning: Bridge egeoffrey-gateway using insecure mode.
    egeoffrey-bridge_1 | 1593429692: mosquitto version 1.6.9 starting
    egeoffrey-bridge_1 | 1593429692: Config loaded from /mosquitto/config/mosquitto.conf.
    egeoffrey-bridge_1 | 1593429692: Opening ipv4 listen socket on port 1883.
    egeoffrey-bridge_1 | 1593429692: Opening ipv6 listen socket on port 1883.
    egeoffrey-bridge_1 | 1593429692: Opening ipv4 listen socket on port 8883.
    egeoffrey-bridge_1 | 1593429692: Opening ipv6 listen socket on port 8883.
    egeoffrey-bridge_1 | 1593429692: Opening websockets listen socket on port 443.
    egeoffrey-bridge_1 | 1593429692: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593429692: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593429692: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593429698: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593429698: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593429698: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.



  • @eporocrail weird, I need to reproduce it to further debug. Meanwhile let me know if you can access your local instance (house id set to boomhut, no password). Thanks



  • @user2684

    No log-in possibility for the normal website access.



  • Have a look at your .env file, it should contain both:

    EGEOFFREY_GATEWAY_HOSTNAME=egeoffrey-bridge
    EGEOFFREY_ID=boomhut
    

    and not other EGEOFFREY_ directives. If not, fix it, stop and start eGeoffrey. Look at the logs to ensure services are connecting fine to the gateway, then try doing the same via the web interface. I believe I forgot to mention EGEOFFREY_GATEWAY_HOSTNAME in my previous instructions.

    Also consider all of this manual configuration should be handled automatically via the cli.



  • @user2684
    Looks a bit different but still authorisation problem:

    pi@raspberrypi:~/egeoffrey $ sudo egeoffrey-cli logs egeoffrey-bridge
    Attaching to egeoffrey_egeoffrey-bridge_1
    egeoffrey-bridge_1 | Generating configuration file...
    egeoffrey-bridge_1 | Starting moquitto...
    egeoffrey-bridge_1 | 1593433932: Warning: Bridge egeoffrey-gateway using insecure mode.
    egeoffrey-bridge_1 | 1593433932: mosquitto version 1.6.9 starting
    egeoffrey-bridge_1 | 1593433932: Config loaded from /mosquitto/config/mosquitto.conf.
    egeoffrey-bridge_1 | 1593433932: Opening ipv4 listen socket on port 1883.
    egeoffrey-bridge_1 | 1593433932: Opening ipv6 listen socket on port 1883.
    egeoffrey-bridge_1 | 1593433932: Opening ipv4 listen socket on port 8883.
    egeoffrey-bridge_1 | 1593433932: Opening ipv6 listen socket on port 8883.
    egeoffrey-bridge_1 | 1593433932: Opening websockets listen socket on port 443.
    egeoffrey-bridge_1 | 1593433932: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433932: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433932: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433938: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433938: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433938: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433944: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433944: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433944: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433948: New client connected from ::ffff:172.21.0.9 as egeoffrey-boomhut-system-watchdog-egeoffrey-gui-d5cef24021 (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433948: New client connected from ::ffff:172.21.0.3 as egeoffrey-boomhut-system-watchdog-egeoffrey-notification-smtp-2026b9e220 (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433948: New client connected from ::ffff:172.21.0.8 as egeoffrey-boomhut-system-watchdog-egeoffrey-service-mqtt-ff2821532d (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433948: New client connected from ::ffff:172.21.0.2 as egeoffrey-boomhut-system-watchdog-egeoffrey-notification-mobile-fa267c3afd (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433948: New client connected from ::ffff:172.21.0.9 as egeoffrey-boomhut-gui-webserver (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433949: New client connected from ::ffff:172.21.0.5 as egeoffrey-boomhut-system-watchdog-egeoffrey-service-fcc_weather-3dfd189271 (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433949: New client connected from ::ffff:172.21.0.3 as egeoffrey-boomhut-notification-smtp (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433949: New client connected from ::ffff:172.21.0.7 as egeoffrey-boomhut-system-watchdog-egeoffrey-controller-362ba2a576 (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433950: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433950: New client connected from ::ffff:172.21.0.2 as egeoffrey-boomhut-notification-mobile (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433950: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433950: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433951: New client connected from ::ffff:172.21.0.8 as egeoffrey-boomhut-service-mqtt (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433951: New client connected from ::ffff:172.21.0.7 as egeoffrey-boomhut-controller-logger (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433951: New client connected from ::ffff:172.21.0.5 as egeoffrey-boomhut-service-fcc_weather (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433952: New client connected from ::ffff:172.21.0.7 as egeoffrey-boomhut-controller-db (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433952: New client connected from ::ffff:172.21.0.7 as egeoffrey-boomhut-controller-config (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433953: New client connected from ::ffff:172.21.0.7 as egeoffrey-boomhut-controller-alerter (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433953: New client connected from ::ffff:172.21.0.7 as egeoffrey-boomhut-controller-chatbot (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433953: New client connected from ::ffff:172.21.0.7 as egeoffrey-boomhut-controller-hub (p2, c1, k60, u'boomhut').
    egeoffrey-bridge_1 | 1593433956: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433956: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433956: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433962: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433962: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433962: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433968: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433968: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433968: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433974: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433974: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433974: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433980: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433980: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433980: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433986: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433986: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433986: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433992: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433992: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433992: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593433998: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593433998: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593433998: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    egeoffrey-bridge_1 | 1593434004: Connecting bridge egeoffrey-gateway (gateway.egeoffrey.com:8883)
    egeoffrey-bridge_1 | 1593434004: Connection Refused: not authorised
    egeoffrey-bridge_1 | 1593434004: Socket error on client local.egeoffrey-boomhut-system-bridge, disconnecting.
    pi@raspberrypi:~/egeoffrey $



  • Ok this means the modules are now connecting to the local gateway so you should be able to login as well via web (boomhut house id, no passcode) but still not connecting to the bridge (which is something I need to replicate). Thanks



  • @user2684
    Yes, access via webpage is working!



  • Good one! As for the bridge, I replicated exactly your same configuration and it is working fine here 😕 I know it is obvious but would you mind checking if the remote_password in the file data/bridge/config/mosquitto.conf is correct? (including the special characters)



  • @user2684

    My mistake. An error in the password. Now it is working!

    Tomorrow I start with the documentation.

    Thanks.



  • @eporocrail ok let me also know if pointing the mobile app or the web interface to the public gateway you can see your data correctly, even from outside the local network



  • @user2684

    Via webpage no access to gateway.egeoffrey.com:1883 and not too gateway.egeoffrey.com:8883



  • @eporocrail you should be using always port 443 from the web interface since using websockets when connecting to the mqtt broker. Also ensure the SSL checkbox is checked. Thanks!



  • @user2684

    web access: gateway.egeoffrey.com:443 has as result:
    400 Bad Request

    The plain HTTP request was sent to HTTPS port



  • @user2684

    Where the remote access to eGeoffrey is almost working I gave it some thoughts.

    Lets go for a complete setup to manage the house and a second one, the holiday home.

    The aim is to come up with a Howto to create from scratch a system to manage both houses.

    Than we have the simple set-up for one house for most users.
    The more sophisticated version is than available for the "admins".



  • The plain HTTP request was sent to HTTPS port

    Sorry, definitely my bad explanation. What I meant was what to enter when you logout from the web interface or from the same in the mobile app and the login screen shows up. The login screen has the following:

    • Gateway:
    • House:
      • House Id: boomhut
      • Passcode: your password
    • User:
      • Username: admin
      • Password: admin

    Basically from any web interface you can login to any instance of eGeoffrey by providing the right gateway



  • @user2684

    When I access eGeoffrey on my Mac via gateway.egeofrrey.com I see the heartbeat and the pushbutton. Also activity is displayed correctly.

    When I do the same on the smartphone I only have the pushbutton. The heartbeat is not visible. Activity of pushbutton is OK.

    When I go for editing the page the heartbeat is not available?????


Log in to reply