Send and Receive MQTT data

MQTT

I made a post last year on how I was finally able to get the ESP to send MQTT data. I had forgotten all about that when I was able to flash the chips again, so I started digging for how to do it. I basically came across the same code somewhere else (can’t remember where), but this time I was able to get send and receiving to work. Decided to share. Once uploaded to the ESP you can see the printed results in the buffer window (I use ESPlorer). Code is below.

 

Moving your Dropbox Folder (macOS)

Dropbox

I have a Mac Pro, it has an SSD. A small one, only 256GB. To combat this I have like everyone else, an external USB (3.0) hard drive. Well I didn’t put much though into Dropbox when I installed it like how much I would use it, and how big the folder is going to get. With all my recent hard drive failure and data loos I am scrambling to do what I can to protect my data now. Better late than never.

The default location for the Dropbox folder is your home directory. If you have a big enough hard drive this will work out just fine. But as I don’t, it did not. I realized I was going to need more Dropbox space, no biggie, they have an upgrade option. OK cool. Ah but hard drive space… that’s an issue. I do have 3TB of external space, so I am not running out of space, just was going to eventually run out of space on the small main drive. The Dropbox upgrade gives you 1TB of backup. I would like to utilize this space as much as possible. It just happens to be that I have an empty 1TB partition on the external drive. Perfect.

Now I need to relocate the folder. Well, the Dropbox app on macOS has a built-in feature to do this. Naturally it didn’t work. It copied the files and folders 100% but then it said I had errors, but wouldn’t tell me what – typical Apple. I tried a few more times. I tried pausing sync first. I tried uninstalling the app. Nothing I tried seemed to work. Then I found the fix for my issue. I unlinked the account. That seemed to delete all the preferences associated with the folder location. I was then able to relink the account and choose the starting location. It worked. Then I paused sync, closed the app and copied the files over manually to the new location real quick so I didn’t have to re-download them all. Restart Dropbox and a few minutes later it was all happy.

I hope you see this BEFORE you install and use Dropbox, but probably not. So hopefully this helps you after the fact.

Forced HTTPS

HTTPS

Since HTTPS is the way of the future, and my host provides it for free why not implement it? So I have added the necessary code to force you to HTTPS on itsalllost.com. All should be well, if not better (I hope).

Hard drive failure

hard drives

Yes, it happened…again. I suffered from a “violent” power surge a couple weeks ago. It was not a normal surge or outage. The power went off and on very rapidly for a few seconds. The lights were flickering all crazy and I swear I heard some electrical crackling. We had two power outages that day. After the first two I ran over and shutoff my Mac and external hard drive.

Later that day when I turned the Mac on I noticed my external drive icons did not appear on my desktop. They were gone. WTF. After a few moments they eventually appeared. I have my external drive partitioned into two parts. The second partition loaded up fine, the first popped up with an error stating I could not write to the drive and that I needed to backup the data and reformat as soon as possible. Oh shit. I immediately opened both drives. They opened in Finder, OK all the data is still there. So I figured something happened obviously. I unmounted the drives and killed power to the external drive. I turned it back on hoping the drives would load, and they did not. Now I had the error on both drives. Fuck.

It’s a 1TB drive and all I have is a 256GB SSD on the Mac. Not even enough space to save all the data. Fuck fuck fuck. After a few days of constantly trying to get the drives to mount I gave up. I copied all the data I could. But after the second try of mounting the drives started coming up with files and folders missing. Oh shit did I lose my shit? I don’t think so. The drives were still reporting the correct usage and free space, so the data has to still be there. Right? After a week of scouring the net I came to the conclusion that the partitioning table got fucked up. I tried repairing it with the Mac but no luck. Soon as I tried the disks unmounted and never came back. Fuck again.

The drive was not working at all on the Mac or Windows. Lets try Ubuntu. Hey they don’t load but I can see the drives in /dev. I still couldn’t mount them, format them or play with the partitions. I tried loading GParted but it would just hang until the drive was unplugged. I let that bitch sit for hours. Believe me I gave everything I did a lot of time to do what it could. Nothing worked. I believe the drive is fucked. I had to go out and purchase another drive. I couldn’t go on any longer without an external drive. And I was getting disk full errors on my Mac. A trip to Fry’s Electronics fixed the no drive issue. Had to drop $100 though. I ended up getting a 3TB (upgrade!) external drive with enclosure. It was $10 more to get the drive+enclosure vs just a bare drive. So I went with caution in case the external drive enclosure was jacked (I don’t think so because I tried the drive with my Apricorn DriveWire) and got the enclosure too.

So I still have the drive, just like the last one that died on me. I am so fucking tired of losing data. Shit is gone that I will never be able to replace… Time to invest in cloud backup storage. 1TB of cloud storage at DropBox doesn’t sound too bad right now.

 

(More) Network Woes

The week I got home from my liver transplant we started having network issues. Like that is just what I needed. The issues are much like the last time (with our Comcast modem, I’d link the post but I can’t find it) except instead of dropping the ISP modem connection my Wifi is deciding to crap out, consistently. When trying to log back on you get the error “cannot obtain an IP address”. Great. I know it’s not the server this time at least, it’s just sitting there and it is working just fine. I had already switched back from ClearOS to a standard router WTF is wrong?

So I thought it was the AP in the garage so I unplugged it, worked for a few hours then the IP issue came back. Plugged it back in and tried unplugging another AP. Same results, worked for a few hours then the issue came back. This time I unplugged all the APs. Same results. Looks like its the router this time.

The router in question is a Buffalo WHR-300HP, which was a good router for the most part. It shipped with DD-WRT installed which was partly why I bought it at the time. Maybe it needs an update. Well apparently they didn’t issue any official updates for it. In my search of the DD-WRT forums I found I could use another routers firmware update instead… no doing that. Not without a back up. I do have other routers lying around but they are old subpar WRTs or other just as old units. It looks like I needed a new router. If I had to get a new router it was gonna have an AC band. So I did a little research and bought one. I nabbed an ASUS RT-ACRH13 (AC1300) Dual Band Gigabit Wireless Router. There were better choices but I was not comfortable dropping $150+ into a wireless router. But I made sure to get something gigabit this time. Now the entire network is gigabit, even the wireless! Ha.

All of the AP’s are powered down and only the ASUS is running. Covers the whole house. It has 2.4gHz and 5gHz bands which is nice. It does do AC but only the tablets and phones have AC modems in them at the moment. Honestly everything else is wired. It would be nice if the TVs and gaming consoles were AC. I would at least settle for N speeds. The router has a USB 3.0 port but I am not using it. I have a full blown server running don’t really need a NAS too. So far the new router is working out nicely, but I don’t care for the interface very much. A little too “Web 2.0”. It’s a wireless router, a piece of network hardware. I don’t need (or want) some fancy ass menus. Other than that its great so far.

But now I am saddened. I had a home built machine running as my router with distributed wireless Access Points throughout the house. Had issues and had to remove the server router. Now I have wireless issues and had to remove the APs. Well I didn’t have to but the new router really makes them obsolete. I no longer have a “cool kickass” home network :(. At least I still have a rack in the garage filled with blinky lights! Which could be reduced down to just one switch probably :(. Now I am sad again.

[contact-form][contact-field label="Name" type="name" required="true" /][contact-field label="Email" type="email" required="true" /][contact-field label="Website" type="url" /][contact-field label="Message" type="textarea" /][/contact-form]