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:
</p> <p># Fetch the stub source</p> <p># note the --recursive option to also install the uNabto SDK</p> <p>git clone --recursive </p> <p>https://github.com/nabto/appmyproduct-device-stub</p> <p># got to the main directory</p> <p>cd appmyproduct-device-stub</p> <p># Create a build directory</p> <p>mkdir build</p> <p>cd build</p> <p># Build the stub</p> <p>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 </p> <p>abcdefgh.qwxyz.trial.nabto.net -k </p> <p>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