You are here

howto: meshchat on Mikrotik hAP using extra USB storage for files

6 posts / 0 new
Last post
KB9OIV
howto: meshchat on Mikrotik hAP using extra USB storage for files

Here is a general outline for setting up extra USB sorage for files, using the USB port on Mikrotik hAP.

You will need to be comfortable using command line and 'vi' editor, and able to follow (but not create) bash.  Internet and/or offline package cache needed.

Do not test this on a production device--make sure you have easy access for reflash if you mess up!

------------------------------------

Prepare USB storage:
format USB as FAT32 on another computer (do not insert to hAP yet)
 
Install packages on hAP:
kmod-usb-storage
kmod-usb2
kmod-fs-vfat
 
Insert prepared USB into hAP
 
Install package 'block-mount' on hAP
 
Copy 'USB Passthrough' script code from near bottom of /etc/rc.d/S99local:
Paste into bottom of /etc/rc.d/S10boot, just before last '}'.
This is required so USB device is available by execution of /etc/rc.d/S40fstab
 
'Comment out' (with #) the 'USB Passthrough' script code from /etc/rc.d/S99local
 
Modify /etc/config/fstab:
Change 'option enable '0'' to '1' for the USB device
 
Reboot hAP and check that USB is mounted
 
Install meshchat .ipk
 
Modify meshchat config to use USB storage:
Change /www/cgi-bin/meshchatconfig.pm:
 
modify these (3) for USB path:
$remote_files_file
$local_files_dir
$tmp_upload_dir
 
modify appropriately:
$max_file_storage  
 
Create any missing folders/subfolders in meshchat USB path with respect to the (3) paths above in meshchatconfig.pm
 
Restart meshchat:
/etc/init.d/meshchatsync restart
 
K9CQB
K9CQB's picture
This should also work on the BaseBox as well, right?

KB9IOV,
This should work on any of the MikroTik devices that have a USB port, like the BaseBox series. Will this also work on the GL devices (AR150, AR300, AR750, etc.) that have USB ports?
Would it be possible to include this working USB storage support as a 'check block' option in the base AREDN firmware like it currently is with USB power or PoE passthrough?

-Damon K9CQB

KB9OIV
I don't have any other

I don't have any other devices to try it on, but if you have those kernel modules available in the repository for your device I would think so?

Give it a shot if you have a device to experiment on!

You will know for sure, if you have the correct USB packages installed, you should see the detection of the USB storage partitions in the output of 'dmesg' command from the cli.  It will absolutely work if you see that.  It is possible that you may need other USB related kernel module packages installed for the other models of devices, I sort of guessed on the correct ones, such as 'usb2' vs 'usb3', etc.

I don't have the coding skills to automate and harden it for inclusion to firmware, I guess you could call this a proof of concept.

Also, you could consider using native linux ext2 filesystem instead of FAT32, or some other filesystem for the USB storage, but keep in mind that Windows OS will not be able to make sense of that filesystem.  

The Mikrotik devices do tend to have extra flash and RAM to support something like this.

Matt, KB9OIV

KB9OIV
Another thing I want to try

Another thing I want to try is GPS ntp support via USB GPS dongle and ntpd.  I bet that could be functional.  The package repository doesn't seem to have usb serial modules included.  The raspberry pi is really good for this stuff, too, but I was looking for a way to use what I have.

AA7AU
AA7AU's picture
GPS-NTP side note

On a side note: I've been struggling trying use an inexpensive USB GPS dongle with an Arch-based (HamVoip) PI to upddate my already existing NTP PI sever (which straddles the mesh as well as the interwebs) but have run into confusing issues which have so far side-tracked me. At this poont, I'm thinking I'll have to go back to a separate Raspian instance for this.

- Don - AA7AU

K5DLQ
K5DLQ's picture
Just be careful of flash

Just be careful of flash storage space after loading the drivers.   On 32MB devices, it's tight.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer