Group Details Private

administrators

Member List

  • RE: Installation issue on Mac OS 10.9.5

    hi @renaud I can't seem to make sense of why your python installation will not instal pyserial.

    From the output you provided:

    Reading http://pypi.python.org/simple/pyserial/
    

    The link works - so easy_install should be able to find the package.

    Well, perhaps you need to upgrade from Mavericks to something newer - or you could try to install pyserial manually here: Pyserial

    posted in Issues & Troubleshooting
  • RE: Installation issue on Mac OS 10.9.5

    @renaud said in Installation issue on Mac OS 10.9.5:

    Hi @stoffera,
    Easy_install is not installed: command not found :((

    I am a bit confused, now easy_install are present? Can you do a:

    $ sudo easy_install pyserial
    

    (skip the -U that I included in an earlier post - also you need to be sudo)

    posted in Issues & Troubleshooting
  • RE: Installation issue on Mac OS 10.9.5

    @renaud sorry about the late reply - apparantly my setup reading RSS with ifttt and forwarding notification does not work properly :-/

    Do you have python installed? Try:

    $ python --version
    

    If yes, then then see if pip is installed. (pip is yet another package manager for python)

    $ pip install pyserial
    

    (You might need to be root)

    posted in Issues & Troubleshooting
  • RE: Installation issue on Mac OS 10.9.5

    Hi @renaud,

    The installation fails when it tries to install a python package to enable serial port communication. Our monomake tool uses this python package to trigger a reset of Mono when it you upload new application to it.

    The caused might be a hiccup in the network, so try again (if you have not already). Another reason that I can think of is that the version of Python included in MacOS 10.9.5 is no longer supported by PyPi or easy_install.

    Could you try to run this command in the terminal app:

    $ easy_install --version
    

    It should respond with something like this:

    setuptools 36.0.1 from /usr/local/lib/python2.7/site-packages (Python 2.7)
    

    Install command

    You can also try to the run the command (from the Terminal.app) the installer package runs, that causes the fault:

    $ easy_install -U pyserial
    
    posted in Issues & Troubleshooting
  • RE: Mono TFT Display

    Hi @james-a-shepard I share your wish for a capacitive display. We would also really have liked a capacitive display. However, the price for a capacitive display to use in Mono was too high for our price tag.

    When we got the Kickstarter funding, we had a lot of talk and worked to find a reasonable priced capacitive display. Unfortunately there were no good options. So we had to go with resistive.

    I hope you will still be able to achieve your planned ideas - even though the display is resistive. Can I ask what your plans are? Maybe I can help answering any questions, that arise.

    Happy hacking :-)

    posted in Issues & Troubleshooting
  • RE: HTTP GET Request Client

    Hi @nicolai I have a complete solution pasted below.

    This code snippet is Arduino code, and does:

    1. Setup UI views for debug console and clock text label
    2. Setup a refresh timer for the clock text label
    3. Initialize wifi (insert your own access point data)
    4. In wifiReady the HTTP request is initialized, insert your own API Key in the URL
    5. In dataReady the http response is parsed with e regular expression
    6. Convert the unix timestamp to a Lib C broken down time
    7. Convert the time to mono's DateTime object
    8. Set the systems datetime
    #include <mono.h>
    
    mono::io::Wifi *wifi = 0;
    mono::network::HttpClient *client = 0;
    mono::ui::ConsoleView<176,110> *console;
    mono::ui::TextLabelView *clockLbl;
    mono::Timer *tim;
    
    void setup() {
      // init console view
      console = new mono::ui::ConsoleView<176,110>();
      console->show();
      
      // init clock label
      clockLbl = new mono::ui::TextLabelView(mono::geo::Rect(10,120,156,45), "-");
      clockLbl->setAlignment(mono::ui::TextLabelView::ALIGN_CENTER);
      clockLbl->show();
      tim = new mono::Timer(999);
      tim->setCallback(&updateClock);
      updateClock();
      tim->start();
      
      // start wifi
      wifi = new mono::io::Wifi("YOUR_SSID_HERE", "YOUR_PASSPHRASE_HERE");
      wifi->setConnectedCallback(&wifiReady);
      
      console->WriteLine("Connecting wifi...");
      wifi->connect();
    }
    
    void updateClock() {
      // repaint the clock label
      clockLbl->setText(mono::String::Format("%s\n%s", mono::DateTime::now().toTimeString()(), DateTime::now().toDateString()()));
      
    }
    
    void wifiReady() {
      if (client == 0) {
        delete client;
      }
    
      // fetch the time stamp from the HTTP API
      console->WriteLine("http fetch...");
      client = new mono::network::HttpClient("http://api.timezonedb.com/v2/get-time-zone?key=YOUR_API_KEY_HERE&format=json&zone=CEST&by=zone&fields=timestamp");
      client->setDataReadyCallback(&dataReady);
    }
    
    void dataReady(const mono::network::HttpClient::HttpResponseData &data) {
      // debug print the received data
      console->WriteLine(mono::String::Format("--> %s",data.bodyChunk()));
    
      // use a regular expression to extract the timestamp from the JSON
      mono::Regex timeReg("\"timestamp\":([0-9]+)");
      mono::Regex::Capture caps[1];
    
      // see if there is a match
      if (timeReg.Match(data.bodyChunk, caps, 1)) {
        //extract the timestamp as a string
        mono::String timeStr = timeReg.Value(caps[0]);
    
        // convert the string to a Lib C time_t
        time_t utime;
        sscanf(timeStr(), "%li", &utime);
        console->WriteLine(mono::String::Format("Parsed %li", utime));
        // convert to a Lib C brokendown time structure
        struct tm *broken = localtime(&utime);
    
        // create a mono DateTime object from the brokendown time
        mono::DateTime time(broken, true);
        console->WriteLine(time.toString());
    
        // set the system clock from the DateTime
        mono::DateTime::setSystemDateTime(time);
        clockLbl->setText(mono::display::GreenColor);
      }
    }
    
    void loop() {
      // Leave this empty
    }
    

    0_1508489442508_IMG_2916.jpg

    posted in Arduino
  • RE: HTTP GET Request Client

    I think the best way to get the time from the Net is to

    1. Register for a free account at timezonedb.
    2. Use the API key it gives you to query their API for the time, like
    http://api.timezonedb.com/v2/get-time-zone?key=YOUR_API_KEY_HERE&format=json&fields=timestamp&by=zone&zone=CET
    

    which will give you something like

    {"status": "OK","message": "","timestamp": 1508269236}
    

    To do that in Mono, you will need to create a HttpClient with the URL above as argument, and then attach a function (that can filter out the timestamp) by using setDataReadyCallback on the client. You can just attach a regular C function that takes a reference to a constant HttpResponseData as argument.

    The HttpResponseData can in general come in several chunks, but by using the API as described above, you can probably ignore chunks (i.e. Finished will always be true) , and simply dig out the timestamp from bodyChunk.

    posted in Arduino
  • RE: Linux support

    Hi @anders-jackson, we have support for Debian/Ubuntu in our own SDK. However, Arduino IDE's board manager only copies files to a directory - which is not enough on Linux. It also needs to set UDEV rules for the USB to work.

    Therefore we do not have an Arduino package for Ubuntu/Debian. Can you use our standard toolchain instead?: http://developer.openmono.com/en/latest/getting-started/install.html

    posted in Arduino
  • RE: What editor do you use?

    @malaire does Geany use anything similar to Sublime Text config files?

    I am thinking about adding support for these files in monomake. In Sublime Text the project json config seems to be pretty generic.

    posted in General Discussion
  • Chores app

    Hi all,

    To scratch an itch of my own, I made a small app that can keep track of all the little tasks one has to do, like watering the plants, washing the car, cleaning the faucets, taking the damn cat to the vet to get the expensive shots, and so on.

    It might be useful for you as well, so install it on your Mono, and check out the source code, especially where I have snatched some code from @stoffera to show a battery indicator, which in turn is based on the nice research done by @malaire.

    posted in Announcements