Status of Wifi API?



  • hi,
    I got my Mono today ... and wanted to start hacking my small project, but this would require wifi and some http communication.
    So, as there are no examples for using those API, I started looking into the include files and found the things I was looking for.
    As I wasn't able to figure out some of the flows/parameters, I looked through the official GIT and found this hardware-test:
    https://github.com/getopenmono/hardware_tests/blob/master/wifiTest/app_controller.cpp
    ... it seems it was written with an older redpine-API (as ModuleSPICommunication c'tor has less parameters)

    I even got my code compiling, but when it is installed the display is just blinking.
    ... so, I hacked around until I was able to see the console-output (I had to add a wait in main-function to attach PUTTY at the right time):
    mbed assertation failed: obj->pin != (PinName)NC, file: ./target_cypress/gpio_object.h, line 41

    ... but this also didn't really help as I don't see any pin which is still set to NC in my sourcecode

    So, more general my question:
    Should the wifi work with the current Installer(using win64)?
    Is there any up-to-date wifi example (or test-project)?



  • The temperature example app uses wifi to send the tempersture to a remote url.



  • good hint ... and it seems to use the up-to-date ModuleSPICommunication ...
    but I still don't see what I'm doing wrong =/
    as I currently have no SD-card for my Mono, I couldn't try the example as it is =/ ... but maybe I'll take the time to hack around that SD part (or buy a SD tomorrow ^^)
    btw. if someone else is also looking for the example sourcecode, it is here:
    https://github.com/getopenmono/temperature/blob/master/internet_upload.cpp



  • ... well, I found it -.-
    it was not the initialization that failed, it was some "scanNetworks" code which I tried.
    I fixed the compiler warning (missing "return true;" at the end of the scanNetworks template, redpine_module.h) and now it works



  • Hi @mhvelplund and @raute_at , great you could find some code at the temperature app.

    I am working on a tutorial for the Wifi module. Please excuse our lack on documentation in this area. We are working on it.


  • administrators

    Hi @mhvelplund and @raute_at, To connect to wifi the temperature example expects 3 files in the root of an SD-card named ssid.txt, pass.txt, url.txt with a single line of text with the respective data.



  • Does someone have any suggestions for what can be used for JSON parsing on mono?

    Or other way around is there any plan to add content parsing features to mono framework?

    ... atm I hacked down a really basic string parsing specific for my data ... works, but looks ugly and error prone ;P


  • administrators

    @raute_at Try and have a look at SmallJSONParser, it has almost no memory footprint , but you will have to pick out the values of the JSON while you are reading it.



  • I was having trouble with SmallJSONParser, so I implemented something basic myself -- https://github.com/aewing/pokemono/blob/master/json_parser.h


Log in to reply