A couple of quick ways to get started with Softata without building the code.

Its all available here: softatawebapii:

The Contents of the softatawebapii site

  • Install the Softata RPi Pico W Sketch.
    • 2 Options:
      • Install non-IoT Sketch
      • Install Azure IoT Hub Sketch
  • App options
    • Run Blockly
    • Run Console App
    • Run as Swagger
  • Documentation
  • Other
  • View Blockly and Swagger Examples

For each of the above, take the softatawebapii link above and follow the directions.

Running the RPi Pico W Sketch

  • Once booted, you get some menu options, so you need a serial terminal to the Pico via USB Serial.
  • First time you need to open this terminal and take the option to enter new configuration details:
    • WiFi SSID
    • WiFi Password
    • IoT Hub details(Hub, Device and connection string)
      • Can be ignored if not using IoT. Just press enter for each.
    • A GUID, can also be ignored.
  • These setting will be saved in flash such that next time their entry can be skipped and you can boot without a terminal.
    • There a coded signals with the inbuilt LED indicating the boot state.
A long 4 second flash on the inbuilt LED indicates that the Pico is waiting for a connection. The inbuilt flash period becomes 1 second once an app connects to it.

The Apps

Once the sketch is running, the simplest app requiring no configuration is the SoftataConsole app. When selected from the softatawebapii site it is activated as a ClickOnce app. You just enter, at the start, the IPAddress of the Pico service as displayed at its startup. You get a menu of tests to run:

  1. Digital Button and LED
  2. Analog Potentiometer and LED
  3. PWM
  4. Servo
  5. Sensors
  6. Displays
  7. Loopback
  8. Analog Potentiometer Light and Sound
  9. USonicRange
  10. Potentiometer and Actuator
  11. GPS Serial
  12. Test OTA Or WDT

Some tests have such as 5. and 10. have a further sub selection menu. They all indicate what connections need to be made.

If at the start an IPAddress/Port is entered different to the default, that gets saved so that next time that is the default.

The Blockly and Swagger app options both run from the softatawebapii site. Both make use of ASP.NET to interact with the Softata .NET library that communicates with the Pico IP service. Blockly simplifies coding by using custom Sofatata Blockly coding blocks. This is based upon NetCoreBlockly.

“Swagger (OpenAPI) is a language-agnostic specification for describing REST APIs. It allows both computers and humans to understand the capabilities of a REST API without direct access to the source code.” Ref msLearn

The Swagger option, similar to Blockly, accesses the same library via ASP.NET and facilitates the exercise of individual class methods within the library.

softatawebapii can be built and hosted locally. The link for it above is though hosted on Azure and can be used for the Blockly and Swagger options. Both will though require some tunnelling from Azure to your local location. This can be done using ngrok (requires a simple installation) or NAT. See Softata: Running Blockly on local Pico from Azure Softata API. If you use ngrok, you only need supply an index with the ngrok startup Blockly blocks and with the ngrok startup Swagger methods.

ngrok

Follow first two steps here: ngrok installation to install ngrok on your desktop. Add authentication later.

With the ngrok setup locally run:

  ngrok tcp 192.168.0.12:4242

… where 192.168.0.12 is the Pico’s IPAddress and 4242 is its TCP service port, this will return with something like:

  Forwarding  tcp://4.tcp.ngrok.io:15129 -> 192.160.012:4242

You only need supply 4 from 4.tcp.ngrok.io as shown to the NgrokConnect block as the IPAddress.
And the Port is 15129.

Correction port is 15129 not 4242 (2Do)

So, “magically”, Blockly running on Azure will connect to the Pico service running locally and orchestrate it!
:)

Footnote

There is also a Blazor app. More on that later.


 TopicSubtopic
<  Prev:   C++ Coding
   
 This Category Links 
Category:Softata Index:Softata
  Next: > Softata
<  Prev:   Softata