Coder Social home page Coder Social logo

Comments (19)

lostbard avatar lostbard commented on July 19, 2024

It should, buts its possible i guess. The main change with 0.12 was the use of of the serialport object instead of the serial object.

Can you provide the output of scanForArduinos("debug") for the 1st and 2nd attempt.

Also what OS are you using, and which version of instrument control and which version of octave ?

from octave-arduino.

splendiduser avatar splendiduser commented on July 19, 2024

Sure, sorry. So I'm using Windows 10 22H2, Octave 8.4.0 and instrument-control-0.9.1. And this is the output:

>> scanForArduinos('debug', true)
* trying comport COM1
>> 165 0 1 0
<<
 ** __initArduino__: failed valid response err=1 - Undersized packet header
* trying comport COM4
>> 165 0 1 0
<< 165 0 1 7
<< 30 152 1 1 50 5 0
>> 165 0 8 1 0
<< 165 0 8 5
<< 0 67 111 114 101
>> 165 0 8 1 1
<< 165 0 8 4
<< 1 73 50 67
>> 165 0 8 1 2
<< 165 0 8 4
<< 2 83 80 73
>> 165 0 8 1 3
<< 165 0 8 6
<< 3 83 101 114 118 111
>> 165 0 8 1 4
<< 165 0 8 14
<< 4 83 104 105 102 116 82 101 103 105 115 116 101 114
 ** found board mega2560
ans =
{
  [1,1] =

    scalar structure containing the fields:

      port = COM4
      board = mega2560

}

>> scanForArduinos('debug', true)
* trying comport COM1
>> 165 0 1 0
<<
 ** __initArduino__: failed valid response err=1 - Undersized packet header
* trying comport COM4
>> 165 0 1 0
<<
 ** __initArduino__: failed valid response err=1 - Undersized packet header
ans = {}(0x0)
>>

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

Thanks - i take a look - it does appear to be working correctly in linux, so will have to look for if anything is happening differently in windows.

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

Something I just thought of ... in scanForArduinos.m, at the bottom its currently:

      unwind_protect_cleanup
        if !isempty (s)
          clear s
        endif
      end_unwind_protect

change the clear s to delete(s) and see if that helps

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

Running windows 11, and its not happening for me on scanForArduinos.

I can make it do it it I run:

a = arduino
a = arduino

Which would try to open the arduino 2x and fail, unless there was a delete between them.

Adding the delete in scanForArduions should still be added and may be enough for it to work for you.

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

Did you have a chance to verify if adding the delete in scanForArduinos worked for you?

from octave-arduino.

splendiduser avatar splendiduser commented on July 19, 2024

Yes and no. I wanted to try it on a different computer but didn't have the chance yet. Since octave.org was down for most of the day I stopped working on it. I can only state one more observation: When using V0.11.0, connecting to the device with Octave only lit up the TX and RX LEDs. Using V0.12.0, the builtin LED (13) lights up twice briefly during the first connection with a = arduino("COM4") in my case. After using clear a and trying to connect again, the LED lights up permanently and the connection attempt fails as described above. So something is strange about the initialization.

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

The light up more than once is to be expected in v12 as the check that it is an arduino is a little more robust (Perhaps it doesnt need to be, but wont effect anything else)

The changing from clear to delete scanForArduinos should be the fix.

from octave-arduino.

splendiduser avatar splendiduser commented on July 19, 2024

On my PC, I have not found a way to make V12 work reliably, including replacing the clear s command. On a different computer with the same OS, Octave, and arduino package versions, the same device behaves as expected - out of the box, i.e., without replacing the clear s command. I don't know why that could be and I'm willing to accept this as a fluke of my system. I'm only using it here as a test bed for another computer. It's a bit unsatisfactory, but works for now. I don't have any ideas what more I can test.

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

To be clear, this is also not working on scanForArduinos? (after changing to use delete(s) )

A related bug in octave rather than this package is assigning the octave 'ans' variable with the arduino object, but shouldnt effect scanForArduinos, and shoulnt effect arduino calls if delete is used on any rduino object before trying to open a new one.

from octave-arduino.

splendiduser avatar splendiduser commented on July 19, 2024

Yes, on the problematic PC changing clear s to delete(s) did not affect the behavior. I also tried s.delete.

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

hmm ... I am out of ideas on the issue currently.

I do have a new version I will be releasing soon that includes a few minor fixes. but I dont think it will help.

I guess when its released, give it a try and let me know

from octave-arduino.

splendiduser avatar splendiduser commented on July 19, 2024

Thank you for your efforts. I will try it when it's out.

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

https://github.com/gnu-octave/octave-arduino/releases/tag/release-0.12.1

from octave-arduino.

splendiduser avatar splendiduser commented on July 19, 2024

I tried V12.1. It didn't change the status quo. Maybe it's just an issue of the hardware combination of the problematic PC. Anyway, I can work with it as it is now. Thanks. If anything changes in the future, I can report again.

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

Thanks for the reply - if i think of anything else could try I will let you know.

On the positive side, it did identify a potential issue in the arduino package, and a bug in octave!

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

Can you try with latest versions of arduino (0.12.1) and instrument-control (0.9.3)

from octave-arduino.

splendiduser avatar splendiduser commented on July 19, 2024

Not until the end of the month, I'm afraid.

from octave-arduino.

lostbard avatar lostbard commented on July 19, 2024

that will be fine!

from octave-arduino.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.