Write code to device and test in offline

Hello,
There is an option to test my IMP device in offline mode?
I saw there are CLI tools and VS Code extension, but both of them seem to deploy my code to impCentral.

I mean, I want to connect my development kit to my computer and connect my sensor to that dev kit, write some code to my device and flash it into my device (which is connected to my computer via USB), then start viewing the device log in my terminal, without the need to login to my impCentral account. Working Offline all the way.

Is this scenario is possible?
Thanks!

Not quite. You can’t send app code via USB. You will need to connect the device at some point in order to get application code onto it via impCentral or the impCentral API (https://developer.electricimp.com/tools/impcentralapi).

This should help for debugging disconnected devices: https://developer.electricimp.com/resources/disconnecteddebugging

TLDR: disconnect the device and log via UART and USB-to-Serial adapter to a computer.

Here’s the Squirrel code I use for this: https://github.com/smittytone/generic-squirrel/blob/main/seriallog.nut. It also logs using server.log() so it will continue to work even when the device is online and not connected to my Mac.

Following on from Tony’s comments - no this is not possible. Electric Imp is an IoT platform, and the development and production environment consist of both code running on the imp (device code) and in the cloud (agent code).

Though impOS 42+ can communicate on the local network, all cloud communication is via the imp-provided-and-secured channel to the agent. Electric Imp provide security and service updates to both the cloud and device itself over the lifetime of the product, and this requires that the product be connected.

All squirrel code compilation happens in the imp cloud; as noted in our policies, you retain ownership of all code you develop in our system - we have rights to compile it and push it to your devices.

This topic was automatically closed after 60 days. New replies are no longer allowed.