Go Down

Topic: 1.5.3 Old Bug? (Read 1 time) previous topic - next topic

rtmsllc

Mar 28, 2016, 08:37 pm Last Edit: Mar 29, 2016, 03:16 pm by rtmsllc Reason: Added additional details
Greetings,

Using IDE 1.6.8 and After the OpenWRT 1.5.3 upgrade,

I get the following error message after a simple REST message to the YUN from Chrome browser ver 49.0.2623.87...the REST message is "arduinoname/arduino/status"


Failed to execute call dispatcher target for entry '/arduino/status'.
The called action terminated with an exception:
?:0: attempt to index a nil value
stack traceback:
[C]: in function 'assert'
?: in function 'dispatch'
?: in function <?:194>

The code is:
Code: [Select]

#include <Time.h>
#include <Bridge.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
#include <Process.h>
BridgeServer server;

void setup() {
....
Bridge.begin();        // initialize Bridge
server.listenOnLocalhost();
server.begin();
Serial.begin(9600);    // initialize serial
....
}

void loop {
....
CheckClient();
....
}

CheckClient() {
void CheckClient() {
BridgeClient client = server.accept();
if (client) {
 String command = client.readString();
 command.trim();                                 // kill whitespace
  Serial.println(command);
 if (command == "status") {
  client.println("Status Requested");
  Serial.println("Connection to Client");
}
}
client.stop();
}



I did not have this problem prior to upgrading to 1.5.3, but don't know what prior version was installed.

There is an old forum topic:

http://forum.arduino.cc/index.php?topic=259389.0

That appears to address this issue and a github commit that "fixes" it...but that info is really dated...

https://github.com/arduino/YunWebUI/issues/12

Anyone have some advice please?

thanks

RT

ShapeShifter

Goodness...I'm obviously new...this IS the complete post...ignore the prior post same subject, I can't find a way to delete same and hoping the kind moderator will do so.  RT
You should be able to go back and edit or remove your old posts. At the bottom right of each post, you should see a "more" link with options to modify or remove posts. Please go back and edit the first post of this thread and make it complete. While you are at it, please add code tags around your code to make it easier to read. You can do this by selecting/highlighting your code, then clicking the </> toolbar button. You can also click that button then paste your code between the tags.

Once that first post is complete, you can remove all of your other posts that bounce between saying it is not complete, then is complete. However, you may not be able to remove the first post that started your other thread: in that case, click the "notify moderator" link and ask a moderator to delete it and say why. That's a lot more reliable than hoping a moderator discovers it on their own.

rtmsllc

Thank you kindly! that was very helpful, I've sent a note to the moderator asking for removal of the duplicate post.  RT

ShapeShifter

Thank you for updating your post, it's much clearer now.

The issue you are reporting seems to be different than the one you are referencing. You are having a problem when running a REST API call. The problem you are referencing is a web interface problem when an SD card with a system upgrade file is inserted into the Yun. This does not seem like the same thing.

Besides updating the system firmware, have you recently upgraded your IDE? I do recall that in the past, people have complained that certain Bridge functions failed when upgrading to a new IDE version. The solution was to go into the Library Manager (IDE menu Sketch | Include Library | Manage Libraries...) and update the Bridge Library. Then rebuild and upload the sketch and try again. That seemed to clear up issues for several people.

rtmsllc

Thank you SS,

From a browser window, typing http://arduinoname/arduino/status should, as far as I know with REST Open, pass the key "status" to the program.

In fact, the echo statement "Connection to Client" is printed on the serial monitor acknowledging that the key was received.

However, when the arduino code attempts to write back to the port at the browser, the following message is received:

Failed to execute call dispatcher target for entry '/arduino/status'.
The called action terminated with an exception:
?:0: attempt to index a nil value
stack traceback:
   [C]: in function 'assert'
   ?: in function 'dispatch'
   ?: in function <?:194>

The message is the same with or without a sd card installed...that's why I referenced the old forum topic and fix at https://github.com/arduino/YunWebUI/issues/12 which did clearly say it was related to the sd.

I've tried several Yun's with the same result. The IDE is 1.6.8 and I have tried reverting to 1.6.7 to no avail.

The Bridge is 1.6.1 which appears to be the current one...perhaps trying an older version? Any thoughts given the exception report above?


rtmsllc

Further to SS's point about the Bridge...I just noticed this message related to same.

Multiple libraries were found for "Bridge.h"
 Used: /Users/RTMSLLC/Documents/Arduino/libraries/Bridge
 Not used: /Users/RTMSLLC/Desktop/Arduino 3.app/Contents/Java/libraries/Bridge

however, I can't find the directory Contents/Java/libraries/Bridge at all on my computer and don't see how an app Arduino 3.app can have sub directories!

strange indeed



ShapeShifter

From a browser window, typing http://arduinoname/arduino/status should, as far as I know with REST Open, pass the key "status" to the program.
Yes, that is how it should work.

Quote
Failed to execute call dispatcher target for entry '/arduino/status'.
The called action terminated with an exception:
?:0: attempt to index a nil value
stack traceback:
 [C]: in function 'assert'
 ?: in function 'dispatch'
 ?: in function <?:194>
This could be a problem in the Linux code that is receiving the information from the sketch and sending it back to the browser. Or, it could be caused by the Bridge Library code in the sketch sending the incorrect data to the Linux code, which causes the Linux code to choke and print an error message.

Quote
The message is the same with or without a sd card installed...that's why I referenced the old forum topic and fix at https://github.com/arduino/YunWebUI/issues/12 which did clearly say it was related to the sd.
Since the message is the same with and without the SD card, it would appear that the SD card is not involved in the problem. So why would you think a problem that is directly related to a problem with the SD card has anything to do with this problem?

Yes, both problems cause error messages to be displayed on the web browser, but other than that I don't see that they have anything to do with each other. There are lots of other problems that can cause error messages to be displayed on the web browser, they are also unlikely to have any bearing on this situation unless the error message is substantially similar. The "field 'day' missing in date table" message from the referenced problem does not seem even remotely similar to "?:0: attempt to index a nil value" from your problem. Your problem sounds like nothing was sent from the Sketch to the Linux code, or something was sent but it was in an improper format.

Multiple libraries were found for "Bridge.h"
 Used: /Users/RTMSLLC/Documents/Arduino/libraries/Bridge
 Not used: /Users/RTMSLLC/Desktop/Arduino 3.app/Contents/Java/libraries/Bridge
It sounds like you have multiple IDE installations and multiple library instances. The IDE is probably getting confused and loading in an incompatible library version. It's very likely that this is the cause of your problem.

Maybe the solution is to uninstall all versions, and delete all IDE application and library instances. Then install again clean?

Quote
don't see how an app Arduino 3.app can have sub directories!
It doesn't look like Arduino 3.app is actually an application file, but is the name of a directory. Just because it has an extension (.app) does not make it a file. A valid directory name can still have periods in it, and could end with ".app".

rtmsllc

I rebuilt the IDE and libraries environment from scratch, and installed 1.6.7 because Time.h is in beta for 1.6.8 according to teensy...

Same results....same errors.

I updated Bridge to the latest version and now have:

Code: [Select]
Multiple libraries were found for "Bridge.h"
 Used: /Users/RTMSLLC/Documents/Arduino/libraries/Bridge
 Not used: /Applications/Arduino.app/Contents/Java/libraries/Bridge


Are IDE 1.6.7 and 1.6.8 storing Bridge in different locations...still can not find a /Contents/Java/libraries/Bridge directory on my computer

I then downloaded FireFox (changed from Chrome) turned off ESET cybersecurity wifi protections and got a pop-up about Boards...(have seen Library update pop-up, but never seen Boards before) and a new ver of AVR that is available 1.6.10 which updated and installed now.

This pop-up had never appeared before so maybe disabling security or changing browsers allowed it to appear.

Anyway....my formerly non-functional boards and normal wifi upload process now work with Arduino AVR Boards v 1.6.10

Also...I've discovered that I must upload new code over wifi when the Yun is NOT Installed in my target hardware, which uses all MPIO pins...

...in a random post I read that pins 10,11,12 (as I recall) are used by the 32U4 for some part of the wifi process....(interrupts perhaps) but it was not immediately apparent by the schematic and i did not bookmark the post...see http://www.arduino.cc/en/uploads/Main/arduino-Yun-schematic.pdf

In any case, my recco is do not program over wifi when your YUN is embedded in your objective hardware.

...now that I can program over wifi, and get the zepto.js benefit of embedded web page(s), the rest is just programming...

thank you,

RT


ShapeShifter

Sounds like you went through a lot of effort, congratulations on getting it working.

Also...I've discovered that I must upload new code over wifi when the Yun is NOT Installed in my target hardware, which uses all MPIO pins...
Yes, when uploading over WiFi, you are actually running avrdude on the Linux side to program the sketch. It does this by concatenating together the Yun's AVR bootloader and your sketch, then using the ICSP header lines to program the image into the AVR processor, just as if you were using an ICSP programming pod with no bootloader. That means it is using the RST, SCK, MISO, and MOSI pins on the 6 pin (2 x 3) programming header. If you have hardware connected to these same pins at the same time that you are trying to load a sketch over WiFi, you could indeed run into conflicts.

rtmsllc

Thankfully this community has a lot of committed members, thanks SS for the support working through it!

Go Up