*MEDIASMARTSERVERD Update* - It's been running for a couple of weeks now, and I don't see any leaks. Here is my updated version of the mediasmartserverd. If anyone has any thoughts or comments on how the activity monitoring section can be better handled, by all means, let me know. I am a 'code when needed' person, and I don't need to very often anymore, so my C++/C mindset is weak.
Things that I am working on as time permits:
1. The program core dumps when a new drive is added. This is big as you can hot-swap drives.
2. Set the bay light's brightness based on activity level - maybe?
Update February 11, 2022:
I have created a daemon for FreeBSD and the EX47x. I've attached it to this message. The tar file includes a binary. I *STRONGLY* suggest running 'gmake clean' and recompiling to ensure you have the necessary libraries and the versions match. You will need GMAKE and GCC to compile this at this time. It requires libcam and libdevstat to run. The binary should be copied to /usr/local/bin and the included .rc file should be copied (removing the .rc extension) to /usr/local/etc/rc.d/, "chmod 755 /usr/local/etc/rc.d/hpex47xled", and hpex47xled_enabled="YES" added to your /etc/rc.conf file. Once these steps are completed, running "service hpex47xled start" should bring up the monitor service. This version puts information into the messages file via syslog() - to see that it has started and what it's monitoring - just "tail -n <some number> -f /var/log/messages". If I get time - I'll create one of these for the EX49x series.
Any suggestions/recommendations will be greatly appreciated regarding C and better ways of writing.
The repository for this program can be found here:
https://github.com/rschmaling/hpex47xled.gitEDIT: 04/02/2022 - the revised version of the EX47x for FreeBSD is on github - I *STRONGLY* recommend cloning or downloading the code from there and compiling it. I have made numerous fixes and added hotplug code from the EX49x codebase - not that it matters - the EX47x doesn't support hotplug... The revised version compiles natively - no gmake or gcc required. Also, it installs the hpex47xled to /usr/local/bin and the .rc file to /usr/local/etc/rc.d. Only manual thing needed is to add hpex47xled_enabled="YES" to your /etc/rc.conf file.
If you have struggled to install FreeBSD 12.3 or 13: First you MUST go through the steps to set the bios to 4(IDE)4(IDE) or FreeBSD will not recognize your drives *AT ALL*.
Instructions to perform this headless (Taken from this forum - you'll need to search):
1. Boot the MediaSmart and as soon as the light flashes red and blue, hit the Delete key to enter BIOS configuration
2. Press the Down Arrow three times and then press Return to select Integrated Peripherals
3. Press the Down Arrow once and press Return to select SiS On-Chip PCI
4. Press the Down Arrow eight times to select SiS Serial ATA Mode
5. Press PgDn once to select 4P(IDE)+4S(IDE) mode
6. Press F10 to save and Return to confirm
After this, you should use VMWare Fusion and mount a drive via USB, boot and attach the drive (won't let you just select it prior to turning on the VM), and follow the prompts. After installing FreeBSD on the external drive, open a shell prior to rebooting and then edit the /etc/rc.conf file to change the ethernet nic. I strongly suggest setting the adapter to static IP during the installation so you only have to change the following:
ifconfig_<whatever it comes up with during install - usually em0>="inet 192.168.xxx.xxx netmask 255.255.255.0" to ifconfig_sge0="inet 192.168.xxx.xxx netmask 255.255.255.0"
FreeBSD uses the SGE driver for the ex47x. After you modify the rc.conf and any other files you wish, just shut down the VM, grab the drive, stick it in a carrier and slap it into the EX47x's lowest drive bay (bay 1) and enjoy.
Let me know if I can be of further assistance.
EDIT: 2/17/2022 - the led-hpex47x module works great except the led API triggers *all* bays regardless of which bay actually has drive activity. I validated this by applying the 'disk-activity' trigger as default for all bays - low and behold, they all blink regardless of a drive present in the bay or not. So to get the same functionality as the mediasmartserverd and the FreeBSD hpex47xled daemon - I present the Ubuntu 20.04 and above version of the hpex47xled daemon. Please find the code available for download via github here -
https://github.com/rschmaling/hpex47xled-LINUX. Clone, make && make install (as root). systemctl start hpex47xled.service && systemctl enable hpex47xled.service. Let me know if you have any issues. Also attached for those that don't want to use git.
EDIT: 2/18/2022 - hpex47xled for Linux - updated to reflect some issues I discovered. See attached hpex47xled_linux.tar.gz. The most recent version will always be available at
https://github.com/rschmaling/hpex47xled-LINUXEDIT: 2/23/2022 - hpex47xled_linux is now threaded. One thread per disk. hpex47xled_linux now turns the bay lights off individually instead of all simultaneously. This should make for a more concise display. I'll be moving on to doing the same thing for the FreeBSD version.
Again - any questions/or if you see issues with the code/functionality - please reach out to me here or github.
EDIT: 3/31/2022 - Taken a while, but here you go - hpex49xled - LED monitoring service for HP Mediasmart Server EX49x (I'm assuming EX48x) FreeBSD 12.3 and above. Should work on any version that supports CAM, devstat, etc.
File: hpex49xled-freebsd.tar.gz
A few notes:
1. I can't thank the original programmers of the mediasmartserverd enough for all their efforts and code - I have ported the code for Acer Altos, H340 - H342 into this service. HOWEVER - I have not activated the code.
2. If you are using an H340 - H342 or Altos as supported in the Linux mediasmartserverd - Please compile and run the camtest program I included (just type make camtest) and send me the results here or as an issue on github. I can use that
information to ensure the path id, unit number, etc., align and are properly accounted for during initialization.
3. Hot-swap works - feel free to pull/add drives.
4. hpex49xled is threaded - one thread per disk. I am only looking at IDE devices, I am only looking for four devices, and I am only looking at the four devices in the enclosure. If adding external eSATA or USB drives causes an issue - please report it to me with some
trace information (like what camtest is telling you the box sees), and I'll track down the issue and fix the code.
5. after running 'make install' as root - you will need to add the following to the bottom of your /etc/rc.conf file: hpex49xled_enable="YES"
As always - The latest version will be available on github -
https://github.com/rschmaling/hpex49xle ... /tree/main You can reach me here or github with concerns, questions, suggestions, and issues. Please let me know if you see something that makes no sense/could be done better and can offer advice.
04/30/2022 - Updated the mediasmartserverd - changed read and write IO from int to uint64_t to avoid overflow.
- Tested on Ubuntu Jammy 22.04
- Bumped the version to 0.7.1 for the hell of it.
- Added code to detect the ex49x BIOS during initialization.
- Changed the code that handles activity - added resolution during extended reads and writes. The lights flicker a bit instead of just staying on.
- I have an idea on how to fix the core dump during hotswap. Work on that next in my C ported version of the daemon on github. I'll move the code after testing.