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:
./amp_device_stub -d abcdefgh.qwxyz.trial.nabto.net -k 18bd8a5f3babd071dbc74985aca0f790
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 # note the --recursive option to also install the uNabto SDK git clone --recursive https://github.com/nabto/appmyproduct-device-stub # got to the main directory cd appmyproduct-device-stub # Create a build directory mkdir build cd build # Build the stub cmake ..make -j3
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:
./amp_device_stub -d abcdefgh.qwxyz.trial.nabto.net -k 18bd8a5f3babd071dbc74985aca0f790SIGN 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:
git clone https://github.com/nabto/ionic-starter-nabto.git
Then run the install script for your desired platform, and build the code, here shown for Android:
Connect your phone to your PC using USB, and run the app on your phone:
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 here