Saturday 21 October 2017

Setting up ThingsBoard

Recently I have been playing with ThingsBoard and decided to setup a local install of ThingsBoard on a virtual machine.

I decided to create a new Centos 7 VM since that is my preferred Linux distribution and it is supported by ThingsBoard.

Things to remember when setting it up:-

  • Add the EPEL repository to yum
    yum install epel-release
    yum repolist
  • Install Java 8 - OpenJava 8 is OK
    yum install java-1.8.0-openjdk java-1.8.0-openjdk-devel
    alternatives --config java
    and ensure java 1.8 is the default
  • Follow the instructions on https://thingsboard.io/docs/user-guide/install/linux/ up to the point of downloading the RPM file. Once ThingsBoard RPM file is downloaded use yum installlocal <ThingsBoard RPM file>
  • Optionally edit the ThingsBoard conflict file to use port 80
  • Add the ports ThingsBoard is using to the firewall.
    • firewall-cmd --permanent --add-port=8080/tcp (for default)
    • firewall-cmd --permanent --add-port=80/tcp (for port 80)
    • firewall-cmd --permanent --add-port=1883/tcp (for MQTT)
    • firewall-cmd --reload
  • Connect your web browser to the Centos machine on the chosen port. You will be asked to login. The default username is sysadmin@thingsboard.org with a password of sysadmin. Now change the password and add tenants and devices etc.

Sunday 19 March 2017

Downloading Apple simulators manually

The other day I decided to download the latest tvOS simulator but the download via Xcode kept failing! I decided to try and download it manually. After a quick google I found that the URL of the download was displayed in the system console the you cancelled the download.

After copying the download URL into Safari, and also using curl via the command line, I had no better luck :(

To get the download to work successfully I found that I had to change the URL from https to http and it just worked! :)

The steps I followed are:

  1. Open XCode, open preferences, go to the Downloads section.
  2. Open the Console App, clear the console for your device (not strictly necessary but makes it easier to find the URL later).
  3. Go back to the XCode preferences. Start the simulator download, then cancel it.
  4. Now in the Console, you will see something about the cancellation with the download URL.
  5. Copy the URL from the Console. Then in Terminal in some suitable directory, download it: 

    curl http://[the url you copied] -O -R 
    (the letter O, not a zero)

  6. Finally, copy this file to ~/Library/Caches/com.apple.dt.Xcode/Downloads
  7. In XCode, in the Downloads section, start the Simulator download again, it should find the file you downloaded and install it.

Example:
robs-macbookpro:~ rob$ curl http://devimages-cdn.apple.com/downloads/xcode/simulators/com.apple.pkg.AppleTVSimulatorSDK10_0-10.0.1.1474488730.dmg -O -R
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1073M  100 1073M    0     0   601k      0  0:30:25  0:30:25 --:--:--  565k
robs-macbookpro:~ rob$ cp com.apple.pkg.AppleTVSimulatorSDK10_0-10.0.1.1474488730.dmg ~/Library/Caches/com.apple.dt.Xcode/Downloads/