OpenSprinkler Forums OpenSprinkler Unified Firmware OpenSprinkler (not OSPi!) Firmware Updater v2

  • This topic is empty.
Viewing 20 posts - 1 through 20 (of 20 total)
  • Author
    Posts
  • #23159

    Ray
    Keymaster

    A new version of the firmware updater software is now available:
    http://rayshobby.net/?page_id=732#upload

    This version supports auto-detection of hardware version, and auto-downloading of the latest firmware. We also removed a lot of unnecessary files and folders in the avr toolset, so the package is significantly smaller than before. When new firmwares become available in the future, you do NOT need to reinstall the updater software, instead, just click on ‘Update and Detect’ in the software and it will grab the latest firmware.

    The software only supports OpenSprinkler 2.0, 2.1, and above.

    Thanks to TechFan who proposed and implemented the ‘auto-downloading’ feature.

    #28253

    TechFan
    Participant

    :). Glad to help!

    Sent from my iPhone using Tapatalk

    #28254

    TechFan
    Participant

    I got this error when clicking Update and Detect button on OSX:

    java.io.IOException: Cannot run program “/Users/username/Downloads/osFirmwareUpdater”: error=13, Permission denied

    Why would I be seeing this. . .if it has permission to run the first time, why after clicking the button?

    #28255

    Ray
    Keymaster

    I can’t reproduce it. The only thing I can think of that would relate to ‘Permission issues’ would be if you were running the program in Linux and encountered USB permission issue. But it shouldn’t happen in Mac. What OSX version do you have?

    #28256

    TechFan
    Participant

    10.9.4 on Macbook air 2011

    #28257

    Ray
    Keymaster

    I have the same version of OSX. After googling the error message, it looks like you may have a folder permission issue. The updater needs to grab osFirmware_info.txt and write it into the folder where the program is (this part is taken from the code you wrote), and you may want to check whether the program folder has write access.

    #28258

    TechFan
    Participant

    Ok. It had to do with the path name. At first I thought it was permissions as well because I had allowed the process via the button on the security page instead of disabling the security completely like I did last time. But, that wasn’t it. I already had an updater in my downloads folder, so it got extracted to osFirmwareUpdater 2 instead of osFirmwareUpdater. It looks like the space in the folder name was the issue. I tested and found that the error is happening in the device detection routine.

    It appears this line doesn’t like being in a path with a space in the osFIrmwareUpdater folder. . .I am not sure how to fix this one though. . .that is why I had different path detection logic in my script, because the .. folder navigation didn’t work when I was testing.

    This is the line that fails on OSX if there is a space in the folder name:

    if(MACOS){
    \ Line added for debugging
    println(“Now I am here – ” + sketchPath(“”) + “../avr-macos/bin/avrdude -C “+sketchPath(“”)+”../avr-macos/etc/avrdude.conf “);
    command = sketchPath(“”) + “../avr-macos/bin/avrdude -C “+sketchPath(“”)+”../avr-macos/etc/avrdude.conf “;
    }

    #28259

    TechFan
    Participant

    Btw, the windows version also seems to have issues with the avr lines. . .

    #28260

    rhldr
    Participant

    I used the new updater over the weekend and it works great. I’m wondering if we can enhance the process to to read the existing configuration and then restore it after successfully flashing the device. I tried using the Chrome app to restore a profile, but it said I didn’t have one saved.

    #28261

    Samer
    Keymaster

    Although unreleased at this point, I have updated my apps to do one of two things moving forward:

    If you are using a device with file support (currently only desktop), you will have an export to file and import file options now. This is essentially a traditional backup/restore method.

    If file support isn’t detected, a new import option has been added allowing a paste of the export email.

    In addition to either of these methods, the previous method of using the app’s storage still exists and works.

    Hopefully this will help the process!

    #28262

    rhldr
    Participant

    That will certainly help.

    Thinking more about this, why not have a function in the firmware to save/restore settings to the SD card if available? Then the updater could do something like this:

    1. Save settings to SD Card
    2. Flash firmware
    3. Restore settings from SD Card

    #28263

    Samer
    Keymaster

    The reason is the limited RAM on the device. The firmware can’t possibly keep track of all the different data storage methods of previous firmwares and convert them on update.

    That’s why I’m handling it in the UI. I admit the process of using the updater to do this (grab config, flash, and upload back config formatted for the new firmware) is a good technique and something to explore.

    #28264

    Ray
    Keymaster

    @TechFan:

    It looks like the space in the folder name was the issue.

    OK, I am able to reproduce the problem as you said. This only happens on Mac (if the folder path has a SPACE character in it), because for some reason Processing assumes the ‘current directory’ on Mac is the home directory; whereas in Windows and Linux the ‘current directory’ is the folder where the executable program exists. Therefore for Windows and Linux you can use the relative path ./ or ../ to reference the firmware files. That’s also why on Mac the code has to use sketchPath(“”) to obtain the absolute path name of the ‘current directory’.

    Anyways, the issue can be fixed by wrapping the path around quotes, something like this:
    command = “”” + sketchPath(“”) + “../avr-macos/bin/avrdude” -C “”+sketchPath(“”)+”../avr-macos/etc/avrdude.conf “”;
    this should solve the SPACE character issue. Will update the programs later today.

    the windows version also seems to have issues with the avr lines. . .

    Can you be more specific? I am not sure what you mean.

    #28265

    TechFan
    Participant

    Hm. I must have put the quote in the wrong place somehow because I thought I tried that without success.

    On windows it fails to download files even when they are missing. . .and fails to run the avr command successfully when compiled. . .it seems I was able to get it to work when running from processing editor. . .

    #28266

    TechFan
    Participant

    On windows 7 x86, this is the error I get:

    java.io.IOException: Cannot run program “..avrbinavrdude”: CreateProcess error=2, The system cannot find the file specified.

    #28267

    Ray
    Keymaster

    I can’t reproduce this error. We’ve tested it on Windows XP, and Windows 8.1, and it works fine. I don’t have a Windows 7 machine right now but I can’t imagine how it works differently on Windows 7 than XP and 8.1.

    Are you running the osFirmwareUpdater.exe in the ‘windows’ subfolder, or are you compiling and running the source code in Processing? If you are running it in Processing, the working directory will be different and hence the relative path would not work.

    #28268

    TechFan
    Participant

    No, running compiled version from windows folder. Strange thing is that running in processing in parallel folder works.

    #28269

    TechFan
    Participant

    I am not sure why it is working differently for me. I have tried it on two different Win7 computers. . .one x86 and the other x64. Both have the same problem. I did figure out what line is causing the issue, but I am not sure why and I don’t know why you aren’t seeing the problem. I guess I was also working on my OSX system that runs off SSD, maybe they are enough faster that they copy was complete before the next command started.

    I commented out this line and the process works. . .it seems this command must still have the file locked when the next process starts which causes it to fail out. . .you added checks for success which is why it is stopping now when it would have just proceeded previously. I guess we need to take it out. . .I just wanted to maintain a backup copy since the process won’t start if this file is missing.

    So, we either need something that can introduce a wait time to allow for completion or remove this line. In other tools, finding a sleep option was simple. . .doesn’t seem so with processing.

    // saveStream(“../os_firmware_info_backup.txt”, “../os_firmware_info.txt”);

    It seems like it should still run/start up even with that file missing. . .and then try to retrieve it. . .

    #28270

    Ray
    Keymaster

    @TechFan: ok, thanks for finding out the cause of the issue.

    Tired of using Processing and learning about its quirks, we are now working on re-writing the updater program using Qt. Hopefully it will be done by this weekend.

    #28271

    TechFan
    Participant

    K. Sounds good

Viewing 20 posts - 1 through 20 (of 20 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware OpenSprinkler (not OSPi!) Firmware Updater v2