Author Topic: CB and Arduino 1.6.x  (Read 48712 times)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #30 on: June 27, 2016, 04:41:53 am »
Code
Error: the index 'RegisterWizard' does not exist

The above happens if you do NOT have the scriptedWizard plugin installed and enabled.

Edit: All your other issues; are NOT related to the CB Wizard change.

Tim S.

hmm.. doesn't look like this is the case. See attached.
Also, if i disable the plugin the CB starts wo issues. And once i enable it it (CB) immediately complains with the above mentioned message.

I should note that the READ.ME states:
Add the following two lines in the RegisterWizards function insde the file ~/.local/share/codeblocks/templates/wizard/config.script

but i did not have this file.

Code
[az@toshiba wizard]$ pwd
/home/az/.local/share/codeblocks/templates/wizard
[az@toshiba wizard]$ ls -l
total 4
lrwxrwxrwx 1 az az  41 Jun 26 13:06 arduino -> /home/az/work/Arduino/cb_arduino_template
-rw-rw-r-- 1 az az 174 Jun 26 22:52 config.script
[az@toshiba wizard]$ cat ./config.script
RegisterWizard(wizProject, _T("arduino"), _T("Arduino Project"), _T("Embedded Systems"));
RegisterWizard(wizTarget,  _T("arduino"), _T("Arduino"),_T("Embedded Systems"));


UPDATE 2:

if i to remove the config.script then CB will load wo issues and the "Arduino project" template will be colored red. once i select it in the attempt to create a new project i'll get "Arduino Project has failed to load XRC resource..." . See below attached.

After that the wizards starts normally.
Once i load the sketch.cpp the "invalid variable" dialog pops up. Doesn't matter what i clikc ( yes/no) the dialog gets created again and again. the way out is to specify the "base" path and click (as many times as needed) the "Yes" button until the dialog goes away.
« Last Edit: June 27, 2016, 05:18:01 am by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #31 on: June 27, 2016, 05:09:01 am »
posting a screenshot

After that if i were to select a UNO it builds the project.

IT definitely does n;t work in "Simulation" mode.
« Last Edit: June 27, 2016, 05:16:16 am by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #32 on: June 27, 2016, 03:27:05 pm »
https://github.com/obfuscated/cb_arduino_template now supports Arduino 1.6.9. Please test and report if there are any problems with the wizard.

Instead of adding 2 "RegisterWizard" lines to the local user's config file, i added (for testing purposes) to the global /usr/share/codeblocks/templates/wizard/config.script.
the New (arduino, arduino) line created a new build target "Arduino". Both "Arduino" and "Arduino Project" wizards are red now and have exact same behavior (same errors, same list of options to select).

The only difference is :
Code
Initializing plugins...
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.
Mozilla universal detection engine detected 'Pure *ASCII*'.
Final encoding detected: Unicode 8 bit (UTF-8) (ID: 41)
ClassBrowser::UpdateClassBrowserView(): No active project available.
NativeParser::GetAllPathsByFilename(): Traversing '/home/az/Dropbox/work/Arduino/cb_arduino_template' for: wizard.*
NativeParser::GetAllPathsByFilename(): Found 0 files:
ClassBrowser::OnThreadEvent(): Updating class browser...
ClassBrowser::OnThreadEvent(): Class browser updated.



when i select a new "Arduino" build target.
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB and Arduino 1.6.x
« Reply #33 on: June 27, 2016, 08:54:19 pm »
What OS are you running?
Changing stuff in /usr is not a good idea if you're on linux.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #34 on: June 28, 2016, 02:22:29 am »
What OS are you running?
Changing stuff in /usr is not a good idea if you're on linux.

Fedora 22. I know, but i'm trying to see what i can do other then say "this doesn't work" that might help you to make thing more robust.
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CB and Arduino 1.6.x
« Reply #35 on: June 28, 2016, 10:37:04 am »
Have you followed all the steps in the README?
Can you paste the output of these two commands:
find ~/.config/codeblocks/ -ls
find ~/.local/share/codeblocks/ -ls
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #36 on: June 28, 2016, 02:54:46 pm »
Have you followed all the steps in the README?
Can you paste the output of these two commands:
find ~/.config/codeblocks/ -ls
find ~/.local/share/codeblocks/ -ls

I renamed config to config1 to be able to load the CB.
Here you go:
Code
[az@toshiba arduino]$ find /home/az/.local/share/codeblocks/ -ls
8929285    4 drwxr-xr-x   5 az       az           4096 Jun 26 13:05 /home/az/.local/share/codeblocks/
8929286    4 drwxr-xr-x   2 az       az           4096 Apr 16 00:12 /home/az/.local/share/codeblocks/plugins
8929287    4 drwxr-xr-x   2 az       az           4096 Apr 16 00:12 /home/az/.local/share/codeblocks/scripts
9964835    4 drwxr-xr-x   3 az       az           4096 Jun 17 16:56 /home/az/.local/share/codeblocks/templates
9964836    4 drwxr-xr-x   2 az       az           4096 Jun 27 20:24 /home/az/.local/share/codeblocks/templates/wizard
9962694    0 lrwxrwxrwx   1 az       az             41 Jun 26 13:06 /home/az/.local/share/codeblocks/templates/wizard/arduino -> /home/az/work/Arduino/cb_arduino_template
9962693    4 -rw-rw-r--   1 az       az             82 Jun 27 20:23 /home/az/.local/share/codeblocks/templates/wizard/config.script1


and :
Code
[az@toshiba arduino]$ find /home/az/.config/codeblocks/ -ls
8929288    8 drwxr-xr-x   3 az       az           4096 Jun 27 20:24 /home/az/.config/codeblocks/
8913529   40 -rw-rw-r--   1 az       az          35735 Jun 11 11:27 /home/az/.config/codeblocks/cbKeyBinder10.ini.bak
8923417    8 -rw-rw-r--   1 az       az            282 Jun 21 16:34 /home/az/.config/codeblocks/default.workspace.layout
8914275    8 -rw-rw-r--   1 az       az            231 Jun 26 13:54 /home/az/.config/codeblocks/DragScroll.ini
8912998   40 -rw-rw-r--   1 az       az          35672 Jun 26 13:40 /home/az/.config/codeblocks/cbKeyBinder10.ini
8913560    8 -rw-rw-r--   1 az       az            128 Jun 11 11:27 /home/az/.config/codeblocks/BrowseTracker.ini
8915296    4 -rw-rw-r--   1 az       az              0 Jun 26 13:54 /home/az/.config/codeblocks/en_US_personaldictionary.dic
8914276  136 -rw-rw-r--   1 az       az         131347 Jun 27 20:24 /home/az/.config/codeblocks/default.conf
8913557    8 -rw-rw-r--   1 az       az            223 Apr 21 19:11 /home/az/.config/codeblocks/default.workspace.save
8914251    8 -rw-rw-r--   1 az       az            233 Jun 26 13:54 /home/az/.config/codeblocks/codesnippets.ini
9964829    8 drwxrwxr-x   3 az       az           4096 Jun 16 15:40 /home/az/.config/codeblocks/share
9964830    8 drwxrwxr-x   3 az       az           4096 Jun 16 15:40 /home/az/.config/codeblocks/share/codeblocks
9964831    8 drwxrwxr-x   3 az       az           4096 Jun 16 15:40 /home/az/.config/codeblocks/share/codeblocks/templates
9964832    8 drwxrwxr-x   2 az       az           4096 Jun 16 15:41 /home/az/.config/codeblocks/share/codeblocks/templates/wizard
9964797    0 lrwxrwxrwx   1 az       az             54 Jun 16 15:41 /home/az/.config/codeblocks/share/codeblocks/templates/wizard/cb_arduino_template-master -> /home/az/.config/codeblocks/cb_arduino_template-master

now i removed the /home/az/.config/codeblocks/share/codeblocks/templates/wizard/cb_arduino_template-master abd renamed config1 to config - same errors persist even if i have only one line in the config:
Code
[az@toshiba wizard]$ ls -l
total 4
lrwxrwxrwx 1 az az 41 Jun 26 13:06 arduino -> /home/az/work/Arduino/cb_arduino_template
-rw-rw-r-- 1 az az 82 Jun 27 20:23 config.script
[az@toshiba wizard]$ cat ./config.script
RegisterWizard(wizTarget,  _T("arduino"), _T("Arduino"),_T("Embedded Systems"));

[az@toshiba wizard]$



codeblocks-contrib:
Code
[az@toshiba wizard]$ rpm -qa | grep codebl
codeblocks-16.01.svn.10868-1.fc22.x86_64
codeblocks-libs-16.01.svn.10868-1.fc22.x86_64
codeblocks-contrib-libs-16.01.svn.10827-1.fc22.x86_64

[az@toshiba wizard]$ rpm -ql codeblocks-contrib-libs-16.01.svn.10827-1.fc22.x86_64
/usr/lib64/codeblocks/wxContribItems/libwxchartctrl.so.0
/usr/lib64/codeblocks/wxContribItems/libwxchartctrl.so.0.0.1
/usr/lib64/codeblocks/wxContribItems/libwxcustombutton.so.0
/usr/lib64/codeblocks/wxContribItems/libwxcustombutton.so.0.0.1
/usr/lib64/codeblocks/wxContribItems/libwxflatnotebook.so.0
/usr/lib64/codeblocks/wxContribItems/libwxflatnotebook.so.0.0.1
/usr/lib64/codeblocks/wxContribItems/libwximagepanel.so.0
/usr/lib64/codeblocks/wxContribItems/libwximagepanel.so.0.0.1
/usr/lib64/codeblocks/wxContribItems/libwxkwic.so.0
/usr/lib64/codeblocks/wxContribItems/libwxkwic.so.0.0.1
/usr/lib64/codeblocks/wxContribItems/libwxled.so.0
/usr/lib64/codeblocks/wxContribItems/libwxled.so.0.0.1
/usr/lib64/codeblocks/wxContribItems/libwxmathplot.so.0
/usr/lib64/codeblocks/wxContribItems/libwxmathplot.so.0.0.1
/usr/lib64/codeblocks/wxContribItems/libwxspeedbutton.so.0
/usr/lib64/codeblocks/wxContribItems/libwxspeedbutton.so.0.0.1
/usr/lib64/codeblocks/wxContribItems/libwxtreelist.so.0
/usr/lib64/codeblocks/wxContribItems/libwxtreelist.so.0.0.1
/usr/lib64/libwxsmithlib.so.0
/usr/lib64/libwxsmithlib.so.0.0.1
/usr/share/doc/codeblocks-contrib-libs
/usr/share/doc/codeblocks-contrib-libs/AUTHORS
/usr/share/doc/codeblocks-contrib-libs/BUGS
/usr/share/doc/codeblocks-contrib-libs/COMPILERS
/usr/share/doc/codeblocks-contrib-libs/COPYING
/usr/share/doc/codeblocks-contrib-libs/ChangeLog
/usr/share/doc/codeblocks-contrib-libs/NEWS
/usr/share/doc/codeblocks-contrib-libs/README
/usr/share/doc/codeblocks-contrib-libs/TODO
« Last Edit: June 28, 2016, 02:59:45 pm by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #37 on: June 28, 2016, 02:59:12 pm »
Are you smart enough to read the code in config.script?

Are you smart enough to add the lines inside the function RegisterWizards()?

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #38 on: June 28, 2016, 04:46:04 pm »
Are you smart enough to read the code in config.script?

Are you smart enough to add the lines inside the function RegisterWizards()?

Tim S.

Tim,
what are you trying to say?
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #39 on: June 29, 2016, 04:32:30 am »
Are you smart enough to read the code in config.script?

Are you smart enough to add the lines inside the function RegisterWizards()?

Tim S.

Tim,
what are you trying to say?

In your prior post you basically said you deleted function X and now you get errors when you call function X.
Your post implied that you have no idea about what you are doing! Therefore, I ask what you did!

Edit: I just re-read your posts; and on Linux the file seems to be missing for you; since, I am a Windows User, I have no idea if this is normal or NOT.
I do know; I have trouble editing this file, config.script, on Windows.

FYI: The function you are calling is defined in config.script; so, when you deleted it. You broke the function!

Tim S.
« Last Edit: June 29, 2016, 05:06:34 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #40 on: June 29, 2016, 05:09:02 am »
Try these two commands; to create the file and then try editing it. I am mainly a windows person; so, these may or may NOT work.

Tim S.

Code
mkdir -p ~/.local/share/codeblocks/templates/wizard
cp /usr/share/codeblocks/templates/wizard/config.script ~/.local/share/codeblocks/templates/wizard/config.script
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #41 on: June 29, 2016, 06:21:49 am »
Are you smart enough to read the code in config.script?

Are you smart enough to add the lines inside the function RegisterWizards()?

Tim S.

Tim,
what are you trying to say?

In your prior post you basically said you deleted function X and now you get errors when you call function X.
Your post implied that you have no idea about what you are doing! Therefore, I ask what you did!

Edit: I just re-read your posts; and on Linux the file seems to be missing for you; since, I am a Windows User, I have no idea if this is normal or NOT.
I do know; I have trouble editing this file, config.script, on Windows.

FYI: The function you are calling is defined in config.script; so, when you deleted it. You broke the function!

Tim S.

You are right - i have no idea how any of these scripts work nor i have a clue about the architecture of the internal workings of CB.
I did see the call " RegisterWizard(wizProject,     _T("arduino"),      _T("Arduino Project"),       _T("Embedded Systems"));" in the main config.script. So i removed the what i thought maybe a duplicate from the local config.script. I'm sorry if it was not clear.

Now, i saw your pull with added step 3a. It does address the issue with the "index" error. Nice work Tim!

Unfortunately, i still get the "Arduino Project has failed to load XRC resource..." warning/error and the "global variable" dialog runs wild (creates tons of windows) and eventually terminates the CB.
« Last Edit: June 29, 2016, 06:26:36 am by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #42 on: June 29, 2016, 06:36:40 am »
Unfortunately, i still get the "Arduino Project has failed to load XRC resource..." warning/error and the "global variable" dialog runs wild (creates tons of windows) and eventually terminates the CB.

I get the "Arduino Project has failed to load XRC resource..." warning/error on Windows (it uses wx2.8 ); I am guessing it is a wxWidgets 2.8 issue; I have NOT had time to confirm it.

No idea why you get "global variable" dialog runs wild on Linux; I was thinking only Windows used a CB "global variable" while Linux used a linked file/directory solution.

How did you do the linked file/directory solution?

Here is my notes on what I used recently on Linux (Debian testing).
Note: I am NOT sure this code below is good or NOT.

Code
cd ~/.codeblocks

ln -s ~/sketchbook sketches

## If self built arduino IDE
cd ~/.codeblocks
ln -s ~/devel/open_source_code/version_control/arduino_ide-git/build/linux/work ~/.codeblocks/arduino

pwd  # /home/stahta01/.codeblocks

## If used Debian Installer for arduino IDE
su
ln -s /usr/share/arduino /home/stahta01/.codeblocks/arduino
exit  # su mode

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline AZ

  • Almost regular
  • **
  • Posts: 151
Re: CB and Arduino 1.6.x
« Reply #43 on: June 29, 2016, 07:17:07 am »
Unfortunately, i still get the "Arduino Project has failed to load XRC resource..." warning/error and the "global variable" dialog runs wild (creates tons of windows) and eventually terminates the CB.

I get the "Arduino Project has failed to load XRC resource..." warning/error on Windows (it uses wx2.8 ); I am guessing it is a wxWidgets 2.8 issue; I have NOT had time to confirm it.

No idea why you get "global variable" dialog runs wild on Linux; I was thinking only Windows used a CB "global variable" while Linux used a linked file/directory solution.

How did you do the linked file/directory solution?

Here is my notes on what I used recently on Linux (Debian testing).
Note: I am NOT sure this code below is good or NOT.

Code
cd ~/.codeblocks

ln -s ~/sketchbook sketches

## If self built arduino IDE
cd ~/.codeblocks
ln -s ~/devel/open_source_code/version_control/arduino_ide-git/build/linux/work ~/.codeblocks/arduino

pwd  # /home/stahta01/.codeblocks

## If used Debian Installer for arduino IDE
su
ln -s /usr/share/arduino /home/stahta01/.codeblocks/arduino
exit  # su mode

Tim S.

> How did you do the linked file/directory solution?

I followed the read.me to the dot.
here is what i have :
Code
[az@toshiba wizard]$ pwd
/home/az/.local/share/codeblocks/templates/wizard
[az@toshiba wizard]$ ls -la
total 20
drwxr-xr-x 2 az az 4096 Jun 29 00:03 .
drwxr-xr-x 3 az az 4096 Jun 17 16:56 ..
lrwxrwxrwx 1 az az   41 Jun 29 00:03 arduino -> /home/az/work/Arduino/cb_arduino_template
-rw-r--r-- 1 az az 6258 Jun 29 00:02 config.script

ls -la /home/az/.local/share/codeblocks/
total 24
drwxr-xr-x   5 az az 4096 Jun 26 13:05 .
drwxr-xr-x. 19 az az 4096 Jun 29 00:17 ..
drwxr-xr-x   2 az az 4096 Apr 16 00:12 plugins
drwxr-xr-x   2 az az 4096 Apr 16 00:12 scripts
drwxr-xr-x   3 az az 4096 Jun 17 16:56 templates

all dirs but "templates" are empty.
I don't have any links to sketches.

To avoid recreation of the dialog i have to click "NO" as many time as it pops up. And managed to set the directory and save that. If i'm lucky i get the CB working fine, if not - "process terminated"
« Last Edit: June 29, 2016, 07:19:08 am by AZ »
CB: nightly build .
Thread model: posix
gcc version 5.1.1 20150618 (Red Hat 5.1.1-4) (GCC)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: CB and Arduino 1.6.x
« Reply #44 on: June 29, 2016, 12:25:36 pm »
I see your problem; somewhere recently he changed the Wizard to use an CB "Global Variable" instead of Linking file/folder solution; but, I did NOT do that change on Linux.
(But, I forgot if I tested the wizard on Linux or not after he asked.)

I will see what the Global Variable is supposed to be.

The base location of the Global Variable needed to be "/home/stahta01/devel/open_source_code/version_control/arduino_ide-git" for me.
( I just tested this location "/home/stahta01/devel/open_source_code/version_control/arduino_ide-git/build/linux/work" and it also worked for me.)

Code
ls /home/stahta01/devel/open_source_code/version_control/arduino_ide-git

The results of the above list needs to contain at least the folders "hardware" and "libraries".
My folders below.
Quote
app  arduino-core  build  examples_formatter.conf  format.every.sketch.sh  hardware  libraries  lib_sync  license.txt  README.md  work

In doing my solution I had to edit an header search path in the Wizard created project
from "$(ARDUINO_DIR)/hardware/arduino/avr/libraries/HID/src"
to "$(ARDUINO_DIR)/hardware/arduino/avr/libraries/HID"


Sorry, about the confusion; I missed when he did the change to Global Variable under Linux.

To create a CB "Global Variable" use
Setting -> "Global Variables ..."
Click on "New" (By the current variable) enter "arduino" for the name of the variable.

I have attached an image of the window below.

Tim S.

 

« Last Edit: June 29, 2016, 12:41:26 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org