We have moved at community.getvera.com

Author Topic: VeraPlus Flash drive usage  (Read 3870 times)

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: VeraPlus Flash drive usage
« Reply #30 on: January 24, 2019, 10:56:58 am »
I have os-command in ALTUI.
So maybe I just need the right commands after setting the usb into vera ! (?)
This is what I have now:

Filesystem                Size      Used Available Use% Mounted on
rootfs                    8.6M      7.8M    824.0K  91% /
/dev/root                10.0M     10.0M         0 100% /rom
tmpfs                   124.8M      6.0M    118.8M   5% /tmp
/dev/mtdblock7            8.6M      7.8M    824.0K  91% /overlay
overlayfs:/overlay        8.6M      7.8M    824.0K  91% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock10          50.0M      1.4M     48.6M   3% /storage
/dev/mtdblock10          50.0M      1.4M     48.6M   3% /etc/cmh-firmware
/dev/mtdblock10          50.0M      1.4M     48.6M   3% /etc/cmh-backup
/dev/mtdblock9           10.0M     10.0M         0 100% /mios

How big is your USB stick?

C

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: VeraPlus Flash drive usage
« Reply #31 on: January 24, 2019, 12:28:02 pm »
@svaleb: Your overlay is 91%... It is close to disaster. Also your USB logging is not enabled.
You may not need a USB drive though it would help to first move your logging there.
I would recommend to first insert a USB stick on the vera and enable USB logging in the vera's settings/log page.

I just realized the OS command is likely not going to work since the vera wants to compress it when you use the build-in upload mechanism. Sorry, you will need to learn to SSH to get into the vera.
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline svaleb

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +11/-7
Re: VeraPlus Flash drive usage
« Reply #32 on: January 24, 2019, 01:59:36 pm »
Hmm, serious.
I used usb logging on my vera 3 some years ago, never thought it would be necessary on the plus as I dont use datamine.
Thought the plus was big enough for the few things I have.
I wil try to mount a usb for logging and get back to you.

Thanks both of you.

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: VeraPlus Flash drive usage
« Reply #33 on: January 24, 2019, 02:29:24 pm »
It is kind of the point of my post to begin with and the mod I am proposing: The vera plus is not making use of the extra storage space offered by the hardware. It is strangely restrincting itself to use 8.6MB of what could be 90MB
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline svaleb

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +11/-7
Re: VeraPlus Flash drive usage
« Reply #34 on: January 24, 2019, 03:27:03 pm »
Yes I am aware of it. (that is why I am interested), but I was not aware I was in the "danger zone".
I have downloaded SCP but it is outside of my terminologi, I dont understand a word.

You mentioned the files could be coppyed into luop files and given a run command, Is this a possibillity ?

IF I knew the Command.

Edit
Just noticed that support, at some point, has checked all these :
Show polling activity
Show individual jobs
Verbose logging
Lock Log Levels (not recommended)
Archive old logs on MiOS (recommended)

Will uncheck verbose and log levels, would it help ?
« Last Edit: January 24, 2019, 03:41:33 pm by svaleb »

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: VeraPlus Flash drive usage
« Reply #35 on: January 24, 2019, 04:00:29 pm »
probably will for the logs.
copying the script into the luup files will not work because moving files this way into the vera will compress them into an lzo format and prevent it from executing.

As for SCP and SSH, maybe let me get you some basics.

Just like many "embedded" devices ranging from your car ECU, to your router, wifi AP, network switch etc, the vera hub is technically a computer. Unlike your PC, it is not designed to interact with the users directly through a screen and keyboard (and mouse). It is designed to be headless, ie boot, load it's operating system and run its code on its own. It is technically not really designed for the user to change anything on it. In order to be programmed though they usually have an access open to the outside world so you can actually talk to it through an interface. For the vera, this interface and protocol is the secure shell aka SSH and it communicates through the TCP/IP ethernet port. Other devices use different interfaces and protocols.
The SSH interface on the vera is run by a program called dropbear which basically opens that communication port and acts as a server.
SSH will allow you to log in to the vera and access its operating system through its CLI (command line interface) which is a program called busybox.
Both of these programs are very common and standard for the operating system called OpenWRT which is a linux distribution originally designed for home wireless routers and open sourced.
Dropbear just happens to also support SCP which is a file transfer protocol allowing us to move files from one computer to another through the ethernet port.

Now with this in mind, the SCP client program (the one you installed on your mac or pc) asks you what host you want to connect to: That will be your vera IP address. You will need the login: it will be "root", and password: It is printed on the label at the bottom of your vera. You may need to make sure that the protocol used is correct: SCP. Once logged in, you can move the files you want into any place on the vera.
With these, you should be able to login to your unit using the SCP protocol but you cannot execute programs on the vera with SCP. For this you will need to access the CLI which will require SSH.

The login name and password are the same as above. You can then go to the folder where you copied the file in question and execute it. The screen will look exactly as if you had a monitor and a keyboard hooked to the vera as a computer. The commands are all standard linux commands. Hope that at least this takes you one step further.
« Last Edit: January 24, 2019, 04:22:18 pm by rafale77 »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline svaleb

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +11/-7
Re: VeraPlus Flash drive usage
« Reply #36 on: January 24, 2019, 04:42:07 pm »
Again, Thanks a lot !
I will try.
Maybe I will contact Catman If I get stuck.
Regards

Offline zedrally

  • Hero Member
  • *****
  • Posts: 1224
  • Karma: +15/-5
  • Black Cat Control Systems
Re: VeraPlus Flash drive usage
« Reply #37 on: January 24, 2019, 06:45:42 pm »
^^^ That login gets me every time. As I infrequently SSH into anything I made it a habit of labelling the login used on the back of the unit. Granted, it's easy if you are forever logging into Vera, but if you only do it every few months you tend to get a Seniors moment....
Living in the Land of Oz, give me a vegemite sandwich. Home Seer, Vera Lite & Edge, Popp, Black Cat Smart Hub & Vera G, Black Cat Lite 1 & 2's a Black Cat Dimmer or 2, Fantem Tec and then some  Black Cat Cat's Eye PIR's & Door-Window Sensors, RFXComm, Broadlink RMPro & Mini plus a Z-UNO or 2.

Offline Catman

  • Sr. Member
  • ****
  • Posts: 338
  • Karma: +10/-0
Re: VeraPlus Flash drive usage
« Reply #38 on: January 25, 2019, 05:16:13 am »
Again, Thanks a lot !
I will try.
Maybe I will contact Catman If I get stuck.
Regards

Feel free

C

Offline svaleb

  • Hero Member
  • *****
  • Posts: 508
  • Karma: +11/-7
Re: VeraPlus Flash drive usage
« Reply #39 on: January 25, 2019, 07:20:21 am »
Rafale you brought me some great steps further
@Catman
I DID come a little further.
With SCP I put the file in "lib" I have had acces with PUTTY...
From there what next ?
I do not know the commands to find and execute the file.

Edit
I am able to reach it in ALTUI OScommand, it must be possible to execute it from there.
« Last Edit: January 25, 2019, 08:10:53 am by svaleb »

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: VeraPlus Flash drive usage
« Reply #40 on: January 25, 2019, 11:22:27 am »
Code: [Select]
cd /lib
cd is for "change directory" should get you to the lib folder.
Then run ./savespace.sh
You can verify the content of the folder by entering
Code: [Select]
ls
Make sure to not run the savespace.sh script twice.
« Last Edit: January 25, 2019, 11:25:10 am by rafale77 »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline Forzaalfa

  • Full Member
  • ***
  • Posts: 227
  • Karma: +5/-0
Re: VeraPlus Flash drive usage
« Reply #41 on: January 25, 2019, 11:34:40 am »
I just uploaded to /etc/ using winscp, then used ssh(putty), and "root"/pw.

went to the /etc/ and typed ./savespace.sh

reply: "Permission Denied".

what now?

Code: [Select]
root@MiOS_50103006:/etc# ls
TZ                     functions_firmware.sh  opkg.conf
TZ-full                functions_leds.sh      passwd
alerts                 functions_usbdrive.sh  ppp
banner                 gcom                   preinit
bluetooth              group                  profile
chatscripts            host_ip                protocols
cmd                    hosts                  rc.button
cmh                    hotplug-preinit.json   rc.common
cmh-backup             hotplug.d              rc.d
cmh-firmware           hotplug.json           rc.local
cmh-lu                 init.d                 resolv.conf
cmh-ludl               inittab                revertspace.sh
cmh-ra                 iproute2               savespace.sh
cmh-static             ld.so.cache            ser2net.conf
cmh-zbfw               ld.so.conf             services
cmh-zwfw               lighttpd               shadow
cmh.factory.default    lighttpd.conf          shells
config                 lighttpd.users         ssl
crontabs               logrotate.conf         sysctl.conf
dbus-1                 logrotate.d            sysupgrade.conf
device_info            mios                   uci-defaults
diag.sh                mios_backup.info       udhcpc.user
dnsmasq.conf           mios_backup.info.old   ule
dropbear               modules-boot.d         usb-mode.json
e2fsck.conf            modules.d              wireless
ethers                 mtab                   zwave
firewall.user          openwrt_build          zwave-aes
fstab                  openwrt_release
functions_3g.sh        openwrt_version
root@MiOS_50103006:/etc# ./savespace.sh
-ash: ./savespace.sh: Permission denied
Vera Plus - RFXtrx433e

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: VeraPlus Flash drive usage
« Reply #42 on: January 25, 2019, 11:38:55 am »
ohh the executionability did not move with the file.

Before executing the file, you need to make it executable:

Code: [Select]
chmod +x savespace.sh
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.

Offline Forzaalfa

  • Full Member
  • ***
  • Posts: 227
  • Karma: +5/-0
Re: VeraPlus Flash drive usage
« Reply #43 on: January 25, 2019, 01:42:53 pm »
Thats better! :D

Code: [Select]
root@MiOS_50103006:/lib# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    8.6M      6.9M      1.8M  80% /
/dev/root                10.0M     10.0M         0 100% /rom
tmpfs                   124.8M      2.1M    122.6M   2% /tmp
/dev/mtdblock7            8.6M      6.9M      1.8M  80% /overlay
overlayfs:/overlay        8.6M      6.9M      1.8M  80% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock10          50.0M      1.4M     48.6M   3% /storage
/dev/mtdblock10          50.0M      1.4M     48.6M   3% /etc/cmh-firmware
/dev/mtdblock10          50.0M      1.4M     48.6M   3% /etc/cmh-backup
/dev/mtdblock9           10.0M     10.0M         0 100% /mios
root@MiOS_50103006:/lib# ./savespace.sh
stopping luup engine
OKmoving cmh files to /storage
create symlinks
starting luup engine
root@MiOS_50103006:/lib# df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    8.6M      2.8M      5.8M  32% /
/dev/root                10.0M     10.0M         0 100% /rom
tmpfs                   124.8M      2.5M    122.2M   2% /tmp
/dev/mtdblock7            8.6M      2.8M      5.8M  32% /overlay
overlayfs:/overlay        8.6M      2.8M      5.8M  32% /
tmpfs                   512.0K         0    512.0K   0% /dev
/dev/mtdblock10          50.0M      5.5M     44.5M  11% /storage
/dev/mtdblock10          50.0M      5.5M     44.5M  11% /etc/cmh-firmware
/dev/mtdblock10          50.0M      5.5M     44.5M  11% /etc/cmh-backup
/dev/mtdblock9           10.0M     10.0M         0 100% /mios
root@MiOS_50103006:/lib#

Thanks, Rafale! I presume all new installs go to the new location? :)
Vera Plus - RFXtrx433e

Offline rafale77

  • Community Beta
  • Hero Member
  • ******
  • Posts: 1749
  • Karma: +101/-27
  • HA ≠ IoT as a blue sky is cloudless.
Re: VeraPlus Flash drive usage
« Reply #44 on: January 25, 2019, 01:44:02 pm »
Yes it will!

By the way, a firmware upgrade will normally revert this script. You can reapply it and then recover from backup to get all your plugins back.

Note: Do not attempt to revert if you already have more data than the original partitition can hold: You should be able to see if from the free space available on /dev/mtdblock7 Vs what you have used in /dev/mtdblock10 minus 1.5M. Given the fact that I doubt there will be any new firmware for our unit for some time, I am not too worried about anyone having to revert but if there is, I will figure out something to help with the migration.
PS: I had a sudden paranoid epiphany and decided to add a few things to the scripts to prevent people from running it twice and risk disabling the vera. Please use the latest version attached. You do not need to do anything if you already applied it. Just use this instead moving forward.
« Last Edit: January 25, 2019, 09:46:54 pm by rafale77 »
openLuup (79 devices, 141 scenes, 19 apps) master to VeraPlus (142 zwave nodes, 8 Zigbee nodes, 221 devices,  20 scenes , 2 apps) +  Hubitat (15 Zigbee nodes) + Home-Assistant (API Integrations). Bridged to Siri and Alexa. Homewave. VeraPlus ExtRooted and mios server independent.