How to test Nabto with only a PC and a smartphone
This tutorial will show you how to get started with your device created using the Nabto Cloud Console. The tutorial will show how to start a simulated device (a thermostat controller) on your PC and how to access this from an app. Once the app and device are paired on the local network you can remote access it simple and secure.
1) Get your first device online
Start the device with your device ID and license key obtained from Nabto Cloud Console when signed in:
<br /> ./amp_device_stub -d abcdefgh.qwxyz.trial.nabto.net -k 18bd8a5f3babd071dbc74985aca0f790<br />
3) Compile your own demo device
The source code for the Nabto Demo thermostat device stub is available at Github.com, where you can find the full details on how to build the device.
Compiling the code yourself requires you to install cmake, a C compiler, and a git client. Once the required software is installed, clone the git repository to your PC, after which cmake is used to build the Nabto thermostat device stub:
# Fetch the stub source<br /> # note the --recursive option to also install the uNabto SDK<br /> git clone --recursive<br /> https://github.com/nabto/appmyproduct-device-stub<br /> # got to the main directory<br /> cd appmyproduct-device-stub<br /> # Create a build directory<br /> mkdir build<br /> cd build<br /> # Build the stub<br /> cmake ..make -j3<br />
Once the code has been compiled, start the device with your device ID and license key obtained from the Nabto Cloud Console when signed in:
<br /> ./amp_device_stub -d abcdefgh.qwxyz.trial.nabto.net -k 18bd8a5f3babd071dbc74985aca0f790<br />SIGN up here
4) Access device with a pre-built app or compile your own demo app
Either download the AppMyProduct Heat app from Google Play or Apple’s App Store. Or build the app yourself from source:
The source code for the demo app is available at Github.com, where the full details for building the app can be found. If you prefer a native app example (currently iOS only), take a look at the Swift example.
Start by cloning the git repository to your PC:
<br /> git clone https://github.com/nabto/ionic-starter-nabto.git<br />
Then run the install script for your desired platform, and build the code, here shown for Android:
<br /> sudo ./scripts/android-install.sh./scripts/android-build.sh<br />
Connect your phone to your PC using USB, and run the app on your phone:
<br /> ./scripts/android-run.sh<br />
Ensure your phone is connected to the same local area network as the PC running the Nabto Demo thermostat device stub. This is needed as the device only allows local connections until it has been paired with your phone. Open the app, press “add new +” to pair your device with your phone.
You can now access your device from the overview page from anywhere as long as both the device and your phone has Internet access using a secure Nabto connection.sign up and try nabto for free