Search code examples
pythonarduinoscons

Building Arduino project using command line scons and getting AssertionError?


I am trying to build Arduino project using command line scons utility. My Arduino home path looks like /home/<name>/Downloads/arduino/ and I have set this path in SConscript file in present working directory from where I am uploading the code. Everything looks file and my device (Arduino yun) is ethernet connected too. Everything looks fine but I am having;

AssertionError: :
File "/home/fahad/Arduino/sketch_oct08a/SConstruct", line 133:
assert(os.path.exists(TARGET+'.pde'))

this error.

Additional information: I am following this link http://www.webweavertech.com/ovidiu/weblog/archives/000482.html and running same sequence of commands. Do you find anything wrong in my perception? Let me know and resolve this problem.


Solution

  • If you read the comment in the SCons above that logic, perhaps that explains your issue?

    # There should be a file with the same name as the folder and with the extension .pde
    TARGET = os.path.basename(os.path.realpath(os.curdir))
    assert(os.path.exists(TARGET+'.pde'))
    

    Do you have a .pde file? Is it in the directory it's complaining about?

    The AssertionError is what you get when the assert statement's condition is not met. In this case the file isn't there..