smartHUB EOL and Acuparse

  • 1
  • Idea
  • Updated 4 weeks ago
Use Raspberry Pi running Acuparse for EOL smartHUB
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes

Posted 3 months ago

  • 1
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
Moved using Raspberry Pi running Acuparse and EOL smartHUB conversation to this post.
(Edited)
Photo of Larry Davidson

Larry Davidson

  • 91 Posts
  • 39 Reply Likes

Posting the answers on having the Acuparse configuration dashboard not coming up because it thinks it is already configured:

I posted the config issue on the Acuparse GitHub issues list.  Here are the answers:

1) You could remove the config file so that it thinks it hasn't been installed: on a terminal do:

cd /opt/acuparse/src/usr ; mv config.php config.php.hold

This moves it out of the way without removing it. Then pull up the webpage http://<your pi ip>/admin/install

or 2) Remove the config file rm /opt/acuparse/usr/config.php

<br>

(Edited)
Photo of Larry Davidson

Larry Davidson

  • 91 Posts
  • 39 Reply Likes
Acuparse appears to have just released and enhancement to block firmware updates to the smartHUB.  I am not sure how to install it but it appears the code is available.
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
Picked up another Raspberry Pi Zero W for testing . Zero W has built in wifi so no need for Ethernet adapter.
Thanks to @Mike Frazier and @Larry Davidson for much of the information below.

1) Downloaded Raspian Stretch Lite from Raspberry site
2) Wrote Stretch Lite to 16 Gig Micro SD Card using Etcher
3) Added blank file named   '   ssh   ' to root of SD Card using Notepad ++
4) Added file named '  wpa_supplicant.conf   ' containing the following information to root of SD Card using Notepad ++

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
       ssid="Your_SSID"
       scan_ssid=1
       psk="Your_Passphrase"
       key_mgmt=WPA-PSK
    }

3) Inserted SD Card in Zero W
4) Connected only power to the Zero W and nothing else, no cable, no display, etc.
5) Powered up Zero W and waited for it to connect to my wifi
6) Monitored my router for clients and saw new connection from the Zero W via wifi with no issues
7) Used Putty to ssh into the IP Address of the Zero W
8) Entered username of '  pi  '
9) Entered password of ' raspberry '
10) Entered '   sudo passwd  ' at the prompt and followed onscreen instructions to change the password
11) Entered '   sudo apt-get update  '  and waited for completion
12)  Entered '  sudo apt-get upgrade ' and entered ' Y ' for yes at a prompt, waited for upgrade to complete
13) Entered ' sudo wget https://raw.githubusercontent.com/acuparse/installer/master/install.sh && sudo sh install.sh  '  to download and install files needed for Acuparse
14) Entered a password for MYSQL ROOT when asked 
15) Entered a password for Acuparse database when asked
16) Entered ' n ' when asked to configure mail since this is a learning curve and don't want to do that now.
17) Entered ' n ' when asked to configure SSL since I think SSL is already present but not sure.
18) Waited for Acuparse to install and received Complete message and instructions to use browser to finish database
19) Used Chrome and entered the IP Address of Zero W
20)  Acuparse webpage appeared with the following;

Hostname   localhost
Database      acuparse
Username     acuparse     which I changed to my name (may have been a mistake)
Password       xxxxxxxxx   entred acuparse database created in step 15

21) Clicked on [SUBMIT] and received blank page with a 1 at the top. Did something wrong obviously.

22) Using Putty again, Entered '  cd  /opt/acuparse/src/usr   ' 
23) Entered '  sudo cp  config.php config.php.old  '  to make a backup copy of config.php
24) Entered ' sudo rm config.php  ' to remove the config.php file
25) Using Chrome again, Entered IP Address of Zero W and received the original webpage as shown above
26) Using Chrome I did not change anything this time other than entering the acuparse database password from step 15
27) After a couple of failures and repeating Steps 24, 25 and 26 from above,  a webpage appeared allowing me to create a first user
28) Entered a username, email address and password and pressed [SUBMIT]
29) Webpage appeared allowing me to configure acuparse and sensors under the username created in Step 28.
30)  Will post more information when available
(Edited)
Photo of Larry Davidson

Larry Davidson

  • 91 Posts
  • 39 Reply Likes

Thanks, I ran into the same thing but haven't yet gotten rid of the config file to try again...  I was thinking you can change localhost to a hostname that you want to use since this is a configuration screen..  I would guess the database and user name should remain acuparse and the MySQL password would be what was entered during install.  Did you trim the database or leave that as disabled?



Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
No trimming at this time since this is basically a test platform. 
Trimming should be enabled according to information I read somewhere and I will do that later.

Don't think at this point you need to enter anything other than the acuparse database password to get to the setup screen.

Once you are in the configuration screen, there is an option to change hostname and trimming if you wish to try it.
(Edited)
Photo of Larry Davidson

Larry Davidson

  • 91 Posts
  • 39 Reply Likes
That was the way I set it (trimming disabled and only entered the acuparse database password) and ended up with the 1 on the screen.  Must be some kind of bug so will try again like you did to see if I can get it to work...
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
Per @Mike Frazier  Once a new version is released, its pretty simple to do the upgrade on your system. You simply do the following on your acuparse system:

cd /opt/acuparse && sudo git pull

Then when you go to your website for your system you will be instructed with anything else you might need to do to finish the upgrade. (That command is in the Install document under Updating).
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
@Larry Davidson, I think it took me three tries of deleting config.php, going back to webiste and entering acuparse database password before I got to the new user screen.
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
Just for information, I used DNSMasq on my Tomato Router to redirect traffic from Acurite to the Raspberry and it worked and is simple to do.
Loaded DD-WRT on a Linksys E3200 for a friend today and tried DNSMasq on it and it worked as well.

what you put in the DNSMasq configuration is;

address=/hubapi.myacurite.com/192.168.xxx.xxx  


NOTE:        (192.168.xxx.xxx is the address of your Raspberry)
You will need to assign your Raspberry a fixed IP Address for this to work or if your router supports it, assign a reserved IP Address to the MAC address of your Raspberry.

On both Tomato and DD-WRT you also have to check  [x] Use Local DNS for things to work. Does not interfere with normal DNS request as far as I can tell.
Photo of Larry Davidson

Larry Davidson

  • 91 Posts
  • 39 Reply Likes
Right now my system is a service provider fiber line into a Calix 844g Gigacenter that includes WiFi.  My four Ethernet ports are full on it so I have one of those ports running Cat 6 to a TP-Link 8 port gigabit switch in my home office.  My smartHUB is ethernet plugged into that switch.  Acurite says the smartHUB is not designed to work on a switch although mine seemed to work before I took it offline to prevent firmware updates.  So, once I have the webserver working, I will need to figure out how to configure everything to block Acurite updates, be able to send data to WU, and be able to access my weather station remotely.  More challenges ahead...
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
Not sure how Acurite does their updates but Acuparse is sitting between your smartHUB and them and is forwarding (or not forwarding depending on settings) information to Acurite.

Since your smartHUB is not directly communicating with Acurite it could be blocking updates now, just don't know.

BTW, my smartHUB has been behind a gigabit switch for the last couple of years or so.
(Edited)
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
If your router supports DDNS that will give you a way to get to your system remotely. I use Dnsexit which is free. Many home routers limit your options in that regard.

Again, if your router supports OpenVPN, that is a reasonably safe way to access your system while away. Better than port forwarding which does expose the Acuparse Raspberry to the outside. 

As posted earlier, I use DNSMasq on my Tomato router to redirect things to acuparse.
Photo of Larry Davidson

Larry Davidson

  • 91 Posts
  • 39 Reply Likes
SUCCESS!!

I blew away the config file, opened it with a browser and left everything at default on the config screen when it came back up..  It was a bit slow but went to the screen to add a new user so I added a new user, email address, and password..  It took me to the Acuparse configuration modification dashboard where most everything can be changed..   I logged out and it took me to the weather dashboard...  So, if I go to the ip address it takes me to the weather dashboard now..  In the upper right corner you can log in and it takes you to the configuration modification dashboard..  Looks like it is working correctly...  So, it appears we have a good draft of the installation instructions..  On mine I used the NOOBS Lite 2.4 to install the Raspbian Stretch Lite with a monitor, keyboard and mouse so that is the only thing different I did from the steps shown above by @Chateau...

During the install I said no to the SSL install so I guess I should go back now and install it.  From there I will have to wait until I get home in a few weeks to connect it all to my smartHUB (working out of state right now).  Once I have done as much as I can here, I will ship the Raspberry to my home for connection to the network when I am next there..

Looking forward:  A static IP address needs to be assigned to the Raspberry.  Is there a simple command line process to do that?  The Acuparse automatically intercepts the traffic from the smartHUB so no changes to the Raspberry or smartHUB I assume??  The next changes would be to Acuparse to send to Weather Underground (?), modify settings in the router to block Acurite access(?), and some method for accessing my weather dashboard on my Raspberry webserver across the internet from my smart phone.  Does this sound about right?
Photo of Larry Davidson

Larry Davidson

  • 91 Posts
  • 39 Reply Likes
The Calix 844g appears to support DDNS but I will need to check with my service provider.  Not sure if it supports OpenVPN...
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
See if your router supports reserving IP address by MAC address. That is what I do on Tomato router. I tell it what IP address to assign to the MAC address of the Raspberry via DHCP.
Failing that you can probably google how to do a fixed IP address on a Raspberry. Pretty sure it will use ifconfig command via ' sudo ifconfig wlan0 xxxx or whatever needs to be entered.

You will have to redirect hubapi.myacurite.com to point to the IP address of the Raspberry. That is what I have been doing in DNSMasq on my router. That is how the Acuparse works, it gets the traffic from smartHUB and then depending on options you have setup either forwards to Acurite on not forward. DNS redirect is the key to all that.

I saw a setting in Acuparse setup that was Weather Underground. Haven't been there yet.
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
Found this after I posted above about static IP Address from here https://raspberrypi.stackexchange.com/questions/37920/how-do-i-set-up-networking-wifi-static-ip-addr...

Edit /etc/dhcpcd.conf as follows:-

 Here is an example which configures a static address, routes and dns.
       interface eth0
       static ip_address=10.1.1.30/24
       static routers=10.1.1.1
       static domain_name_servers=10.1.1.1

       interface wlan0
       static ip_address=10.1.1.31/24
       static routers=10.1.1.1
       static domain_name_servers=10.1.1.1
ip_address is the address and size from the command above (or another unused address on the same network), routers is the address of your router (or gateway). domain_name_servers is the DNS address(es) from /etc/resolv.conf. (see man dhcpcd.conf)

You will be using wlan0 for wireless. Substitute your IP address in the range of your router. Make sure it is outside of the DHCP range your router uses. For example, if your router assigns IP address in the range of 192.168.1.100 to 192.168.1.150 and in that case you would want to use static (fixed) IP address of say 192.168.1.200 or 192.168.1.99 or whatever. Some routers use 192.168.1.1 as their address or 192.168.1.254 so stay away from those. 

Note: As I recall the /24 at end of the examples sets a subnet mask of 255.255.255.0 which is good. You would need to end your address with the /24
Note: static routers=xxx.xxx.xxx.xxx is the IP Address of your router
Note: static domain_name_servers will generally be the IP Address of your router
(Edited)
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
@Larry Davidson, in regard to going back to setup SSL, I saw that being installed during the auto installation of Acuparse. It is associated with email but not sure what else.
Photo of Larry Davidson

Larry Davidson

  • 91 Posts
  • 39 Reply Likes
Actually during the install on mine (NOOBS approach) it asked if I wanted mail and if I wanted SSL so I said no to both..  I wasn't sure if SSL was going to be needed for remote access.  Anyway, talked to my service provider and they don't think there is a problem with using DDNS.  They elevated my questions and will call me back tomorrow or Monday on the OpenVPN and IP Reservation questions.  However, looking at the documentation on the Calix 844g it appears it supports both DDNS and IP Reservation to a MAC Address..  IP reservation looks a lot easier than assigning a static IP to the Raspberry just don't know how the security process works in that case..
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
I know of no security issue in assigning a static IP Address via MAC address, or at least I think that is what you are saying. I have done it for many years on my routers and have not encountered any problems to my knowledge.

A lot of routers support DDNS but they restrict you to only a couple of providers. Hopefully yours will let you setup one of the free ones.

I think the SSL thing was to set up a certificate on the Raspberry, but not sure. I don't know what all SSL does myself. I know there was a huge security hole in OpenSSL a few years back that was fixed. 
(Edited)
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
Put this here for information only.

Syslog:

View your syslog to see the data flowing through your system and to look for any trouble. Enable debug logging for a more detailed view.

tail -f /var/log/syslog
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
Found this link created by @Mike Frazier author of  Acuparse. None of this would be possible without his work. Thanks Mike.

Link https://support.acurite.com/acurite/topics/script-to-parse-display-and-upload-smarthub-data and link to his webpage https://www.acuparse.com/
(Edited)
Photo of Mike Frazier

Mike Frazier

  • 65 Posts
  • 25 Reply Likes
Ok, first off, I'm not the author of Acuparse, just a user of it since I found it at the beginning of the year.  Maxwell (Max) Power is the author of Acuparse.

I just got dnsmasq working on my Raspberry Pi Zero W that is running Acuparse.  By doing this, you can then just go on your router and change the DNS server setting to by your Acuparse server.  Then you have control of doing the config of overriding the IP addresses needed.  IMO this is more simple than hacking firmware on the router, or doing some double ethernet trick.  As its after 2:45am for me, I'm going to bed now, but will try to write up the steps on doing this tomorrow.  Larry, if you don't have that piece working yet, you can be the first to try it on your set up if you want ;)

And yes, Acuparse 2.2.1 was released tonight by Max.  It fixes an issue with Access devices and it sets up where the SmartHub won't get firmware updates and Acuparse now sends back a response to the SmartHub so it thinks its talking to Acurite servers.  As stated above, on your Acuparse server just do the following: 

cd /opt/acuparse && sudo git pull

After that completes, you can then go to your weather page with a browser and login, and you should be prompted to complete the steps (its good to make backups, but I didn't have any issue when I did the upgrade tonight).
Photo of Chateau

Chateau

  • 113 Posts
  • 30 Reply Likes
@Mike Frazier, sorry for the confusion on my part and thanks to @Max Power for a neat program that works well.

Running DNSmasq on a Raspberry does sound good for anyone not having third party firmware such as Tomato or DD-WRT on their routers. It is not a hack on those routers, instead a simple option in the web interface GUI.

Just did the update using  Putty to ssh into my Raspberry and entering ' cd /opt/acuparse && sudo git pull ' which completed almost instantly.  Then used Chrome to access the Raspberry webpage and followed on screen prompts. This competed almost instantly as well. Cudos to @Max Power.
(Edited)
Photo of Cor Dikland

Cor Dikland

  • 46 Posts
  • 4 Reply Likes
One thing I am unsure of is the way the hardware is connected. Currently my SmartHub is connected to my Rasp Pi 3 via USB/Eternet cable adapter and the PI ii self is connected directly to a router port. 

With this configuration, should my SmartHub be connected directly to a router port? 
Can I continue to have the PI hardwired to a port or this the installation instructions for AcuParse assume it is connected via WiFi??
Photo of Mike Frazier

Mike Frazier

  • 65 Posts
  • 25 Reply Likes
There are different ways of setting things up.  For me, my smarthub is on the main level of my house near the wall where my 5 in  1 is located in my backyard.  This is also where my router is at, so its conected directly to the router.  My RPi, is actually in my home office upstairs, and is only connected via WiFi (Since its a Pi Zero W, I don't have a USB ethernet dongle on it, so just using WiFi).  I could easily move it downstairs with the smarthub (and may eventually do that) but I'm still playing around with it, so its easier to just keep it in my home office since thats where I tend to be when I'm working on this stuff.

There could be benefits to hooking up the smarthub directly to the acuparse server via an ethernet cable.  You could set up your server to work like a router for a separate network between the two, and then use your other network adapter for your regular LAN connected to your router. More complex to do though, just depends how comfortable you are with doing networking like that.

As for your acuparse server, it just needs a network connection.  Doesn't matter if its via a network cable or WiFi.