Build an open future with us.

Invest in Mycroft and become a community partner.

Conecting to the mycroft web client


#21

Traceroute is also uninteresting because it provides no information.

traceroute to mark1.local (Real IP Address Appears Here), 30 hops max, 60 byte packets
 1  * * *
 2  * * *
 3  * * *
 4  * * *
 5  * * *
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
11  * * *
12  * * *
13  * * *
14  * * *
15  * * *
16  * * *
17  * * *
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  * * *
24  * * *
25  * * *
26  * * *
27  * * *
28  * * *
29  * * *
30  * * *

I’m able to connect to the Mark I via ssh without difficulty.


#22

Darn I thought that would have shown something. No firewall? Nothing like that? I wonder if it’s a ufw command that’s needed, like

sudo ufw allow 8081


#23

Nope, my laptop and the Mark I are on the same internal network. No firewall between them. The only slight variation (and this sounds weird) is that my laptop is wired to the network, and the Mark I is wireless. They’re connected to the exact same router though.


#24

Aaaaaaaah!

OK, check to see whether your router has something called “wireless isolation” turned on. It’s kinda like a firewall between wired and wireless devices.


#25

As far as I can tell, my router doesn’t have anything called that on or off. I wasn’t able to locate any settings in my router configuration like that.


#26

@linuxrants, @KathyReid
Thought I would chime in on this. if you used my code as is I had the IP address for my device hardcoded.
This should be changed to the IP address of your Mark1.


#27

That was just a link to your original code. It was updated to the correct local IP before I posted here.


#28

No problem, thought I would be sure. Just an FYI my route has a setting called AP isolation I think that is the same thing. Are you able to execute the code on a device that is also on wifi and not hardwired?


#29

No. I tried from my work computer and that didn’t work, but it’s Windows and who knows what the heck is going on there. I also tried it on another Linux workstation I have in the house, with the same results. I thought this might be relevant.

nmap -Pn TheCorrectIPAddressIsHere -p 8181

Starting Nmap 7.60 ( https://nmap.org ) at 2018-07-11 13:46 MST
Nmap scan report for mark_1 (TheCorrectIPAddressIsHere)
Host is up.

PORT     STATE    SERVICE
8181/tcp filtered intermapper

Nmap done: 1 IP address (1 host up) scanned in 2.11 seconds

I get this from both Linux workstations I try to use.


#30

Not sure, your troubleshooting tools are not familiar to me. A simple thing that I did here was enter the ip_address:8181 in my browser on my remote linux computer and returned the following.

Traceback (most recent call last):
File “/opt/venvs/mycroft-core/lib/python3.4/site-packages/tornado/web.py”, line 1390, in _execute
result = self.prepare()
File “/opt/venvs/mycroft-core/lib/python3.4/site-packages/tornado/web.py”, line 2103, in prepare
raise HTTPError(self._status_code)
tornado.web.HTTPError: HTTP 404: Not Found

For the record I have a debian machine hardwired to my network and a picroft on wireless.


#32

I have a working version now. I felt we were getting a little too far into the weeds troubleshooting my local network, so I moved the code onto my Mark I and used the virtual environment that Mycroft itself uses. After one very stupid mistake this morning, it’s working. I appreciate your time and patience, and that of @KathyReid.


#33

I wanted to let you and @KathyReid know what all the fuss was about. It’s not world shattering or anything, but I did have something I was aiming for. I took your script @pcwii and made a super minor change to it. It pull the command that is sent to the message bus from the command line instead of having it hard coded in. I had intended on having your script be something that I could call from remote hosts for notification purposes, but I had trouble with the network stuff (which I’m sure you remember). Instead, I cobbled together a quick POC for myself that checks disk usage against a predefined threshold. Looks like this:

#!/bin/ksh

ms_threshold=90
host_name=`hostname`

send_message(){
  ssh -n pi@mark1.local "/home/pi/mycroftMessageBus.py \"${ms_message}\""
}


if [ -f fs_check.txt ]
then
  while read LINE
  do
    echo "Checking ${LINE}."
    ms_drive=`echo ${LINE}|cut -d\/ -f3`
    use_percent=`df -h|grep ${LINE}|sed 's/ \{1,\}/|/g'|cut -d\| -f5|cut -d\% -f1`

    if [ ${use_percent} -gt ${ms_threshold} ]
    then
      ms_message="speak Storage threshold exceeded for ${ms_drive} on ${host_name}. Drive is ${use_percent} percent full."
      send_message
      sleep 10s 
    fi
  done < fs_check.txt
fi

echo "All done"

So, what this basically does is check how much of a drive is used, and then it calls your script (slightly modified) on the Mark I to speak aloud the alert that I choose to send it. Again, this is just a super crude POC, but it works, and it’s something I can adapt further for any kind of alert I want to send anywhere on my network. Again, thank you both so much for your help.


#34

I’m sorry for the delay.
I was migrating all my services for Mycroft with Python 3, now they are ready and working.
Here you can find the Web Chat Client as an independent service, also the presence detection service