Issue #4 new

seestar2_lib

Jonas Follesø
created an issue

I'm trying to upload the SeeStar Arduino sketch onto the Pro Mini. The source code is available on codebender at https://codebender.cc/sketch:199916.

I've followed the setup instructions on CodeBender, and installed the drivers and the chrome extensions, but I still get an error at their getting started tutorial step 4, where CodeBender wants to test the connection. It sees the port, but I get an error when hitting "Run on arduino".

Using the Arduino IDE I've been able to verify that my serial connection works, and that the Arduino Pro Mini functions correctly (installed the blinking LED example).

So my next step was to download the SeeStar sketch and try to upload it from the Arduino IDE.

When hitting the Verify button I get the following error message:

/Users/follesoe/Dropbox/SeeStar_II_Release/SeeStar_ProMini/SeeStar_ProMini.ino:61:45: fatal error: atmega328pwr.h: No such file or directory
 #include <atmega328pwr.h>    // seestar2_lib

So the problem is that I do not have the seestar2_lib available on my computer, and I can't find any references to it in the seestar repository. I think it would be nice if the Arduino Sketch and instructions for libs were available in the central repository - or at least instructions for where to download seestar2_lib.

Comments (11)

  1. Steve Haddock

    I agree we should have the sketch and libraries in the repo and not just Codebender. I'll pass this along to the software engineer.

    Thanks again for the helpful feedback.

  2. tmaughan

    As a quick fix, I've pushed the seestar_v2_lib and SeeStar_ProMini sketch into the SeeStar II Release folder and have added the library to the bitbucket downloads for quick access. When I'm back in the office I'll add a README.md with instructions on how to add the library to the standalone Arduino IDE. The limitation on library download from CodeBender is unfortunate, apologies for not testing that.

    Location of files: seestar / SeeStar_II_Release / Software /

  3. Jonas Follesø reporter

    Thanks for responding to my issue so quickly.

    I've downloaded the seestar_v2_lib.zip file, and added it to the Arduino IDE using Sketch - Include Library - Add .ZIP Library. Next, when I try to verify the code I get a new error (I got past the atmega328pwr.h error): SeeStar_ProMini.ino:62:45: fatal error: SerCmd.h: No such file or directory

    If I do Sketch - Include Library - seestat_v2_lib the following lines of code are inserted at the top of the sketch:

    #include <atmega328pwr.h>
    #include <config.h>
    #include <ds3234.h>
    #include <SerialCommand.h>
    

    So it looks like the name SerCmd.h (used in the sketch) has changed to SerialCommand.h in the library. If I change the include name, I get some different errors (so probably the SerialCommand module has changed as well?)

  4. tmaughan

    Well it looks like checking in code while rushing out the door is not such a good idea - I uploaded the wrong library. I don't have access to the board just now for full test and verification, but this time I've built the code before sending (and have also reviewed the code to make sure it's the same library as on codebender). Please see the download for the correct library version. I've also updated the git repo. I'll do a full test tomorrow when I get back to the office.

  5. Jonas Follesø reporter

    Excellent. I was able to build and deploy the code onto the board. Following the instructions in comments section under operation, I was able to connect to the Arduino and get the message:

    Config loaded from EEPROM
    Duration 12000 sec,  3.33 hrs
    Start Delay 45 sec
    Video Duration 0 sec
    Interval between videos/images 600 sec
    Low battery threshold  12500 mV
    Start Flag is OFF
    Config Version 1.0
    
    SeeStar2, v1.0,  software by Thom Maughan
    Setup is Complete
    1900.02.20 21:35:21
    

    I've been able to connect using both an app called Serial, the screen command, and the Arduino Serial Monitor. However, I'm not able to send/have it respond to the h or m commands. Am I missing something, is there something special I need to do in order to have it respond to commands?

  6. Jonas Follesø reporter

    Been playing some more with the code, and if I comment out line 341 (SCmd.readSerial();), and change the serial_handler function to read the rxByte using Serial.read() instead of SCmd.getCharCmd(); I'm able to process commands (using the single character commands).

    So it looks like there might be some problem with the Serial Command library? Could there be a bug in the seestar2_lib zip file you uploaded tmaughan ?

  7. Jonas Follesø reporter

    After digging some more through the code I might have found the problem. The SerCmd library uses \r as terminator:

    // This checks the Serial stream for characters, and assembles them into a buffer.
    // When the terminator character (default '\r') is seen, it starts parsing the
    // buffer for a prefix command, and calls handlers setup by addCommand() member
    void SerCmd::readSerial()
    

    The Arduino IDE Serial Monitor uses Newline as default, not Carriage return. When changing to Carriage return in Serial Monitor I was able to issue commands!

    EDIT: I can now issue the HELP command and get the menu, when compiling and with the SHIELDPLUGGEDIN commented out. If I compile with the shield, and connect the Arduino to the shield, I get serial output (startup text, and a timer displaying the date time), but I cant issue commands. Same behaviour if I connect to the Arduino using the FTDI and a jumper on J4, or if I connect directly to the serial on J5.

    EDIT2: After making a change in SerCmd.cppline 102 to echo back: Serial.print(inChar); // Echo back to serial stream I'm able to see what SerCmd sees.

    When connected to the shield, it echoes back bad data () , but if I disconnect the Arduino from the shield while still connected to serial, it starts working (i.e I can type HELP and see the menu).

    So there is some kind of problem I don't quite understand yet in regards to serial input when connected to the shield.

    I did a quick recording showing the problem: https://www.dropbox.com/sc/7xgzn4vxc136160/AABTYhDVwYtrfSznJyZGN4gDa

  8. Chad Kecy

    Jonas - Did you trying installing jumper J4 when trying to communicate via serial? If the jumper is not installed, there can be a conflict on the Tx line. I had the same problem during testing, but that jumper fixed it for me.

  9. Jonas Follesø reporter

    Today I got it working - not sure why I was working now...

    I have it connected using FTDI, with a jumper on J4. I can now issue commands over serial when the Arduino is connected to the shield.

  10. Log in to comment