Forum

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.





Pages: [1]
Author Topic: Controller keeps changing width to 85197550
pashakun
Newbie
Posts: 4
Permalink
Post Controller keeps changing width to 85197550
on: March 7, 2020, 09:20
Quote

Hi,
Discovered something weird while trying to troubleshoot an empty pixel problem -- the controller thinks my machine is 85197550 wide.
I double checked my default.properties file and it is all good.
I tried LOAD CONFIG and UPLOAD MACHINE SPEC, all the properties seem fine. But when I do DOWNLOAD SPEC right after, it changes my machine into a narrow wide sliver.

Looking at the readout in the Processing console I see this line:
incoming: Loaded width:85197550
It keeps repeating. The full readout below.

New properties file exists.
new propertiesFilename: C:\Users\pasha\Documents\Processing\polargraphcontroller\default.properties.txt
Successfully loaded properties file C:\Users\pasha\Documents\Processing\polargraphcontroller\default.properties.txt
machine size: 1579.0, 1579
windowHeight:1022
Polygonizer: 1
PolygonizerLength: 1.0
Finished loading configuration from properties file.
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
Dispatching command: C25,PGXXABCD,END
Last command:C25,PGXXABCD,END
incoming: MSG,E,C25,PGXXABCD,END not recognised.
incoming: READY
incoming: READY
Dispatching command: C24,750,1300,END
Last command:C24,750,1300,END
incoming: Loaded width:85197550
incoming: Loaded height:1300
incoming: READY
Dispatching command: C29,95,END
Last command:C29,95,END
incoming: Loaded width:85197550
incoming: Loaded height:1300
incoming: Loaded mmPerRev:95.00
incoming: Loaded steps per rev:1048776
incoming: Loaded step multiplier:16
incoming: Loaded down pos:90
incoming: Loaded up pos:180
incoming: Recalc mmPerStep (0.00), stepsPerMM (176635.95)
incoming: Recalc pageWidth in steps (2147483647)
incoming: Recalc pageHeight in steps (229626736)
incoming: READY
Dispatching command: C30,200,END
Last command:C30,200,END
incoming: Loaded width:85197550
incoming: Loaded height:1300
incoming: Loaded mmPerRev:95.00
incoming: Loaded steps per rev:200
incoming: Loaded step multiplier:1
incoming: Loaded down pos:90
incoming: Loaded up pos:180
incoming: Recalc mmPerStep (0.47), stepsPerMM (2.11)
incoming: Recalc pageWidth in steps (179363280)
incoming: Recalc pageHeight in steps (2736)
incoming: READY
Dispatching command: C37,16,END
Last command:C37,16,END
incoming: Loaded width:85197550
incoming: Loaded height:1300
incoming: Loaded mmPerRev:95.00
incoming: Loaded steps per rev:1048776
incoming: Loaded step multiplier:16
incoming: Loaded down pos:90
incoming: Loaded up pos:180
incoming: Recalc mmPerStep (0.00), stepsPerMM (176635.95)
incoming: Recalc pageWidth in steps (2147483647)
incoming: Recalc pageHeight in steps (229626736)

My setup:
- Udoo x86 w/ Arduino 101 (Intel Curie)
- Windows 10
- Processing 2.2.1
- Adafruit Motor Shield V2
- Polagraph code built from source

Any pointers would be greatly appreciated ~

Thank you

Image

sandy
Administrator
Posts: 1424
Permalink
sandy
Post Re: Controller keeps changing width to 85197550
on: March 7, 2020, 15:13
Quote

Hi there - this is interesting! Good detective work.

(EDIT - just googled for "arduino 101 eeprom" - arduino 101 doesn't actually have EEPROM and emulates it instead, and that words differently - https://forum.arduino.cc/index.php?topic=418020.0 may have your solution.)

...
It does look like the numbers are loading from your default.properties.txt file ok.

There's a line there

Dispatching command: C24,750,1300,END
Last command:C24,750,1300,END
incoming: Loaded width:85197550
incoming: Loaded height:1300

That shows the setting value being sent (750mm wide machine), and the wrong value being posted back. That message comes from here

void eeprom_loadMachineSize()
{
  EEPROM_readAnything(EEPROM_MACHINE_WIDTH, machineWidth);
  if (machineWidth < 1)
  {
    machineWidth = DEFAULT_MACHINE_WIDTH;
  }
  Serial.print(F("Loaded width:"));
  Serial.println(machineWidth);
  
  EEPROM_readAnything(EEPROM_MACHINE_HEIGHT, machineHeight);
  if (machineHeight < 1)
  {
    machineHeight = DEFAULT_MACHINE_HEIGHT;
  }
  Serial.print(F("Loaded height:"));
  Serial.println(machineHeight);
}

And you can see that it's using EEPROM_readAnything(<address to read from>, <variable to put the value into>) to find the value and copy it into machineWidth. EEPROM_MACHINE_WIDTH is the constant that holds the address of that machine-width value in the non-volatile EEPROM.

The value that you want to send into that slots gets there

void exec_setMachineSizeFromCommand()
{
  int width = atoi(inParam1);
  int height = atoi(inParam2);

  // load to get current settings
  int currentValue = width;
  EEPROM_readAnything(EEPROM_MACHINE_WIDTH, currentValue);  
  if (currentValue != width)
    if (width > 10)
    {
      EEPROM_writeAnything(EEPROM_MACHINE_WIDTH, width);
    }
  
  EEPROM_readAnything(EEPROM_MACHINE_HEIGHT, currentValue);
  if (currentValue != height)
    if (height > 10)
    {
      EEPROM_writeAnything(EEPROM_MACHINE_HEIGHT, height);
    }

  // reload 
  eeprom_loadMachineSize();
}

https://github.com/euphy/polargraph_server_a1/blob/master/exec.ino#L108-L131

It retrieves the value from EEPROM with EEPROM_readAnything, checks to see if the new value is different (in your case it checks if 750 == 85197550), and if it _is_ different, then it uses EEPROM_writeAnything to put the new value into EEPROM. Finally we reload everything from EEPROM so it's loaded in the right order.

So, that EEPROM_writeAnything isn't having the effect we expect it to. This might be because EEPROM is damaged somehow, is worn out, or that EEPROM doesn't work on your board the way it does on ATMEGA Uno boards. I could find some online conversation about that that suggested that your board doesn't even have EEPROM. That might still be true, but there is obviously some kind of non-volatile memory there, because some of the values you're uploading ARE being retained.

Check that by looking at the console and resetting the board - if it has non-volatile memory then you'll see it reporting the size of itself using some numbers that you've put into it.

The memory may be special somehow - I see that the width value is put into address 0 of the EEPROM on a real UNO:

const byte EEPROM_MACHINE_WIDTH = 0;

https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L112

There might be something special about address 0. It could be damaged, it could be anything tbh.

You could attempt a fix by changing that address to 46

const byte EEPROM_MACHINE_WIDTH = 46;

and doing an "reset machine to factory" from the controller. That issues a C27,END command that fills the first 50 bytes of EEPROM with zeros.

Great problem!

Sandy

pashakun
Newbie
Posts: 4
Permalink
Post Re: Controller keeps changing width to 85197550
on: March 8, 2020, 02:08
Quote

Sandy,

Thank you for such a quick and detailed response!
At least part of me is glad about having a "great" problem 😛

So, I change the address to 46 in Arduino file and reflashed it.
Things continued to remain interesting.
I took a bunch of screenshots, but can't seem to attach them here. Here's a weblink:
https://www.evernote.com/l/AAOu3ADVDm1A5YrFFKe6o-jIgK3iWzPtw88/

Text summary:
- controller first loads at the specs specified in the defaults file
- after factory reset and download of specs the machine measures 650x650
- re-uploaded default specs and tried to download back and it now is 0x0..
- repeating the above steps blows up dimensions to an insane number

The full (and long) readout is below:

incoming: Loaded down pos:90
incoming: Loaded up pos:180
incoming: READY
Dispatching command: C31,600,1,END
Last command:C31,600,1,END
incoming: New max speed: 600.00
incoming: READY
Dispatching command: C32,400,1,END
Last command:C32,400,1,END
incoming: New accel: 400.00
incoming: READY
incoming: READY
incoming: READY
Dispatching command: C26,END
Last command:C26,END
incoming: 0. 0
incoming: 1. 0
incoming: 2. 20
incoming: 3. 5
incoming: 4. 0
incoming: 5. 0
incoming: 6. 0
incoming: 7. 0
incoming: 8. 0
incoming: 9. 0
incoming: 10. 0
incoming: 11. 0
incoming: 12. 0
incoming: 13. 0
incoming: 14. 0
incoming: 15. 0
incoming: 16. 190
incoming: 17. 66
incoming: 18. 200
incoming: 19. 0
incoming: 20. 16
incoming: 21. 0
incoming: 22. 0
incoming: 23. 0
incoming: 24. 22
incoming: 25. 68
incoming: 26. 0
incoming: 27. 0
incoming: 28. 200
incoming: 29. 67
incoming: 30. 0
incoming: 31. 0
incoming: 32. 0
incoming: 33. 0
incoming: 34. 0
incoming: 35. 0
incoming: 36. 0
incoming: 37. 0
incoming: 38. 0
incoming: 39. 0
incoming: PGSIZE,750,1300,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGMMPERREV,95.00,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSTEPSPERREV,1048776,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSTEPMULTIPLIER,16,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGLIFT,90,180,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSPEED,600.00,400.00,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
Dispatching command: C27,END
Last command:C27,END
New properties file exists.
new propertiesFilename: C:\Users\pasha\Documents\Processing\polargraphcontroller\default.properties.txt
Successfully loaded properties file C:\Users\pasha\Documents\Processing\polargraphcontroller\default.properties.txt
machine size: 1579.0, 1579
windowHeight:984
Polygonizer: 1
PolygonizerLength: 1.0
Finished loading configuration from properties file.
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: Loaded width:650
incoming: Loaded height:650
incoming: Loaded mmPerRev:95.00
incoming: Loaded steps per rev:400
incoming: Loaded step multiplier:1
incoming: Loaded down pos:0
incoming: Loaded up pos:0
incoming: Recalc mmPerStep (0.24), stepsPerMM (4.21)
incoming: Recalc pageWidth in steps (2736)
incoming: Recalc pageHeight in steps (2736)
incoming: READY
Dispatching command: C25,PGXXABCD,END
Last command:C25,PGXXABCD,END
incoming: MSG,E,C25,PGXXABCD,END not recognised.
incoming: READY
incoming: READY
Dispatching command: C24,750,1300,END
Last command:C24,750,1300,END
incoming: Loaded width:750
incoming: Loaded height:1300
incoming: READY
Dispatching command: C29,95,END
Last command:C29,95,END
incoming: Loaded width:750
incoming: Loaded height:1300
incoming: Loaded mmPerRev:95.00
incoming: Loaded steps per rev:400
incoming: Loaded step multiplier:1
incoming: Loaded down pos:0
incoming: Loaded up pos:180
incoming: Recalc mmPerStep (0.24), stepsPerMM (4.21)
incoming: Recalc pageWidth in steps (3157)
incoming: Recalc pageHeight in steps (5473)
incoming: READY
Dispatching command: C30,200,END
Last command:C30,200,END
incoming: Loaded width:750
incoming: Loaded height:1300
incoming: Loaded mmPerRev:95.00
incoming: Loaded steps per rev:200
incoming: Loaded step multiplier:1
incoming: Loaded down pos:0
incoming: Loaded up pos:180
incoming: Recalc mmPerStep (0.47), stepsPerMM (2.11)
incoming: Recalc pageWidth in steps (1578)
incoming: Recalc pageHeight in steps (2736)
incoming: READY
Dispatching command: C37,16,END
Last command:C37,16,END
incoming: Loaded width:750
incoming: Loaded height:1300
incoming: Loaded mmPerRev:95.00
incoming: Loaded steps per rev:1048776
incoming: Loaded step multiplier:16
incoming: Loaded down pos:0
incoming: Loaded up pos:180
incoming: Recalc mmPerStep (0.00), stepsPerMM (176635.95)
incoming: Recalc pageWidth in steps (132476968)
incoming: Recalc pageHeight in steps (229626736)
incoming: READY
Dispatching command: C45,90,180,1,END
Last command:C45,90,180,1,END
incoming: Loaded down pos:90
incoming: Loaded up pos:180
incoming: READY
Dispatching command: C31,600,1,END
Last command:C31,600,1,END
incoming: New max speed: 600.00
incoming: READY
Dispatching command: C32,400,1,END
Last command:C32,400,1,END
incoming: New accel: 400.00
incoming: READY
incoming: READY
Dispatching command: C26,END
Last command:C26,END
incoming: 0. 0
incoming: 1. 0
incoming: 2. 20
incoming: 3. 5
incoming: 4. 0
incoming: 5. 0
incoming: 6. 0
incoming: 7. 0
incoming: 8. 0
incoming: 9. 0
incoming: 10. 0
incoming: 11. 0
incoming: 12. 0
incoming: 13. 0
incoming: 14. 0
incoming: 15. 0
incoming: 16. 190
incoming: 17. 66
incoming: 18. 200
incoming: 19. 0
incoming: 20. 16
incoming: 21. 0
incoming: 22. 0
incoming: 23. 0
incoming: 24. 22
incoming: 25. 68
incoming: 26. 0
incoming: 27. 0
incoming: 28. 200
incoming: 29. 67
incoming: 30. 0
incoming: 31. 0
incoming: 32. 0
incoming: 33. 0
incoming: 34. 0
incoming: 35. 0
incoming: 36. 0
incoming: 37. 0
incoming: 38. 0
incoming: 39. 0
incoming: PGSIZE,750,1300,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGMMPERREV,95.00,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSTEPSPERREV,1048776,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSTEPMULTIPLIER,16,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGLIFT,90,180,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSPEED,600.00,400.00,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
incoming: READY
Adding COM3
portNo: 1
Mar 08, 2020 10:49:39 AM controlP5.ControlBroadcaster printMethodError
SEVERE: An error occured while forwarding a Controller event, please check your code at button_mode_serialPortDialog
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at controlP5.ControlBroadcaster.invokeMethod(Unknown Source)
at controlP5.ControlBroadcaster.callTarget(Unknown Source)
at controlP5.ControlBroadcaster.broadcast(Unknown Source)
at controlP5.Controller.broadcast(Unknown Source)
at controlP5.Button.setValue(Unknown Source)
at controlP5.Button.activate(Unknown Source)
at controlP5.Button.mouseReleased(Unknown Source)
at controlP5.Controller.setMousePressed(Unknown Source)
at controlP5.ControllerGroup.setMousePressed(Unknown Source)
at controlP5.ControlWindow.mouseReleasedEvent(Unknown Source)
at controlP5.ControlWindow.mouseEvent(Unknown Source)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1236)
at processing.core.PApplet.handleMethods(PApplet.java:1431)
at processing.core.PApplet.handleMouseEvent(PApplet.java:2826)
at processing.core.PApplet.dequeueEvents(PApplet.java:2725)
at processing.core.PApplet.handleDraw(PApplet.java:2397)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at controlP5.ScrollableList.updateIndex(Unknown Source)
at controlP5.ScrollableList.setValue(Unknown Source)
at polargraphcontroller.addSerialPortControlFrame(polargraphcontroller.java:6220)
at polargraphcontroller.button_mode_serialPortDialog(polargraphcontroller.java:7106)
... 26 more
incoming: READY
In dropdown_serialPort, newSerialPort: 0
Disconnecting serial port.
Adding COM3
portNo: -1
Mar 08, 2020 11:00:40 AM controlP5.ControlBroadcaster printMethodError
SEVERE: An error occured while forwarding a Controller event, please check your code at button_mode_serialPortDialog
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at controlP5.ControlBroadcaster.invokeMethod(Unknown Source)
at controlP5.ControlBroadcaster.callTarget(Unknown Source)
at controlP5.ControlBroadcaster.broadcast(Unknown Source)
at controlP5.Controller.broadcast(Unknown Source)
at controlP5.Button.setValue(Unknown Source)
at controlP5.Button.activate(Unknown Source)
at controlP5.Button.mouseReleased(Unknown Source)
at controlP5.Controller.setMousePressed(Unknown Source)
at controlP5.ControllerGroup.setMousePressed(Unknown Source)
at controlP5.ControlWindow.mouseReleasedEvent(Unknown Source)
at controlP5.ControlWindow.mouseEvent(Unknown Source)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1236)
at processing.core.PApplet.handleMethods(PApplet.java:1431)
at processing.core.PApplet.handleMouseEvent(PApplet.java:2826)
at processing.core.PApplet.dequeueEvents(PApplet.java:2725)
at processing.core.PApplet.handleDraw(PApplet.java:2397)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at controlP5.ScrollableList.updateIndex(Unknown Source)
at controlP5.ScrollableList.setValue(Unknown Source)
at polargraphcontroller.addSerialPortControlFrame(polargraphcontroller.java:6220)
at polargraphcontroller.button_mode_serialPortDialog(polargraphcontroller.java:7106)
... 26 more
In dropdown_serialPort, newSerialPort: 1
About to connect to serial port in slot 0
Successfully connected to port COM3
incoming: READY
Dispatching command: C27,END
Last command:C27,END
incoming: Loaded width:650
incoming: Loaded height:650
incoming: Loaded mmPerRev:95.00
incoming: Loaded steps per rev:400
incoming: Loaded step multiplier:1
incoming: Loaded down pos:0
incoming: Loaded up pos:0
incoming: Recalc mmPerStep (0.24), stepsPerMM (4.21)
incoming: Recalc pageWidth in steps (2736)
incoming: Recalc pageHeight in steps (2736)
incoming: READY
Dispatching command: C26,END
Last command:C26,END
incoming: 0. 0
incoming: 1. 0
incoming: 2. 0
incoming: 3. 0
incoming: 4. 0
incoming: 5. 0
incoming: 6. 0
incoming: 7. 0
incoming: 8. 0
incoming: 9. 0
incoming: 10. 0
incoming: 11. 0
incoming: 12. 0
incoming: 13. 0
incoming: 14. 0
incoming: 15. 0
incoming: 16. 0
incoming: 17. 0
incoming: 18. 0
incoming: 19. 0
incoming: 20. 0
incoming: 21. 0
incoming: 22. 0
incoming: 23. 0
incoming: 24. 0
incoming: 25. 0
incoming: 26. 0
incoming: 27. 0
incoming: 28. 0
incoming: 29. 0
incoming: 30. 0
incoming: 31. 0
incoming: 32. 0
incoming: 33. 0
incoming: 34. 0
incoming: 35. 0
incoming: 36. 0
incoming: 37. 0
incoming: 38. 0
incoming: 39. 0
incoming: PGSIZE,650,650,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGMMPERREV,95.00,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSTEPSPERREV,400,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSTEPMULTIPLIER,1,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGLIFT,0,0,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.
incoming: PGSPEED,800.00,800.00,END
Polygonizer: 1
PolygonizerLength: 1.0
regenerating preview queue.

Also, in case it is related, I have problem getting serial connection from the start. It is solved by first choosing No Serial Connection and then COM 3, as some people posted earlier.
The error read out at that time is below, fyi:

ar 08, 2020 10:49:39 AM controlP5.ControlBroadcaster printMethodError
SEVERE: An error occured while forwarding a Controller event, please check your code at button_mode_serialPortDialog
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at controlP5.ControlBroadcaster.invokeMethod(Unknown Source)
at controlP5.ControlBroadcaster.callTarget(Unknown Source)
at controlP5.ControlBroadcaster.broadcast(Unknown Source)
at controlP5.Controller.broadcast(Unknown Source)
at controlP5.Button.setValue(Unknown Source)
at controlP5.Button.activate(Unknown Source)
at controlP5.Button.mouseReleased(Unknown Source)
at controlP5.Controller.setMousePressed(Unknown Source)
at controlP5.ControllerGroup.setMousePressed(Unknown Source)
at controlP5.ControlWindow.mouseReleasedEvent(Unknown Source)
at controlP5.ControlWindow.mouseEvent(Unknown Source)
at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1236)
at processing.core.PApplet.handleMethods(PApplet.java:1431)
at processing.core.PApplet.handleMouseEvent(PApplet.java:2826)
at processing.core.PApplet.dequeueEvents(PApplet.java:2725)
at processing.core.PApplet.handleDraw(PApplet.java:2397)
at processing.core.PGraphicsJava2D.requestDraw(PGraphicsJava2D.java:240)
at processing.core.PApplet.run(PApplet.java:2256)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
at java.util.ArrayList.elementData(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at controlP5.ScrollableList.updateIndex(Unknown Source)
at controlP5.ScrollableList.setValue(Unknown Source)
at polargraphcontroller.addSerialPortControlFrame(polargraphcontroller.java:6220)
at polargraphcontroller.button_mode_serialPortDialog(polargraphcontroller.java:7106)
... 26 more

Thank you again!

sandy
Administrator
Posts: 1424
Permalink
sandy
Post Re: Controller keeps changing width to 85197550
on: March 8, 2020, 15:01
Quote

Good traces there - the usb serial port issue is common, that's how I do it too. I could never figure out an elegant way to handle that in the structure of the user interface.

I think this is unpredictable enough that I think I'd stop looking for a way to work around it in the code, and investigate the curieEEPROM library (as described on https://forum.arduino.cc/index.php?topic=418020.0).

Polargraph uses EEPROM.h (
https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L106), and accesses it through EEPROMAnything.h, which is a little wrapper for getting different data types out.

You could just replace that import EEPROM.h line with an import CurieEEPROM.h. The interface might be the same as EEPROM enough that EEPROMAnything will work fine - give that a shot.

(CurieEEPROM mentioned here as being in v1.6.8 of the Arduino IDE https://blog.arduino.cc/2016/03/09/arduino-ide-1-6-8-available-for-download/)

sn

pashakun
Newbie
Posts: 4
Permalink
Post Re: Controller keeps changing width to 85197550
on: March 9, 2020, 07:30
Quote

Looks like Arduino has discontinued CurieEEPROM a while back. It's no longer available under Manage Libraries.

I might just have to take this up in Arduino forums. Will report here if anything resolves. In the meantime the ugly work around is to connect an UNO via USB, ugh....

Thank you for all your help so far ~
And, by the way, you've built an amazing thing here!

sandy
Administrator
Posts: 1424
Permalink
sandy
Post Re: Controller keeps changing width to 85197550
on: March 9, 2020, 20:55
Quote

Looking at the EEPROM example code that's for the Curie board, there's no mention of CurieEEPROM so maybe it got superceded, and it should work after all.

So it's behaving a bit screwy. Address 0 looks dodgy, and the slot for stepsPerRev misbehaves too - that's 18. You could change that to 48 and see if that goes any further.

https://github.com/euphy/polargraph_server_a1/blob/master/polargraph_server_a1.ino#L115

sn

pashakun
Newbie
Posts: 4
Permalink
Post Re: Controller keeps changing width to 85197550
on: March 11, 2020, 05:35
Quote

Just tried that, the problem persists.

On the plus side, everything is working fine when I connect Arduino Uno via USB ~

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.34 ; Page loaded in: 0.038 seconds.