Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Old payload not working for new firmware. #4

Closed
vanishing opened this issue Nov 16, 2014 · 20 comments

Comments

Projects
None yet
5 participants
@vanishing
Copy link

commented Nov 16, 2014

https://developer.thalmic.com/downloads
myo-raw is not working with the newest firmware(Updated Nov 14, 2014).

@renhyl

This comment has been minimized.

Copy link

commented Nov 17, 2014

Hi,

I am getting this when I try to run phyton myo_raw.py

File "/Library/Python/2.7/site-packages/serial/serialposix.py", line 289, in open
self.fd = os.open(self.portstr, os.O_RDWR|os.O_NOCTTY|os.O_NONBLOCK)
OSError: [Errno 16] Resource busy: '/dev/cu.usbmodem1'

Please can anyone help?

@jwcrawley

This comment has been minimized.

Copy link

commented Nov 17, 2014

Yeah, your only hope here is to revert to older firmware.
If they've locked that, then you'll have to hack an older firmware to newer version #s.

If you already have the device, then consider this a learning experience (sadfully). If you dont have the device, don't buy one.

Also, it turns out they are a YCombinator funded company, so Hacker News shitcans ALL articles regarding them.

@dzhu

This comment has been minimized.

Copy link
Owner

commented Nov 17, 2014

@renhyl: I'm guessing your problem might be caused by having Myo Connect running at the same time, preventing any other program from accessing the dongle. If it's not running, then I don't know. You might try using the lsof command to see what has the /dev file open.

@vanishing and @diana-js: @jwcrawley is right. Official word from Thalmic is that the EMG data is no longer sent in firmware version 1.0 and up, though it sounded like there was some hope of it being exposed again in the future. I'd appreciate knowing if it's possible to revert to older firmware from 1.0.

@vanishing

This comment has been minimized.

Copy link
Author

commented Nov 17, 2014

I reverted to 0.8 and using it now..
It's sad that they are taking away the only linux implementation currently possible for now...

@dzhu

This comment has been minimized.

Copy link
Owner

commented Nov 17, 2014

Well, it should be possible to figure out the protocol that the new firmware uses, just the same as I did here, unless they've gone and encrypted it or added a secure handshake or something. I'll go and do that at some point when I have time. (Even if it gets encrypted, since we have access to the SDK binary, it'll be possible in principle to dive in and reverse engineer that, although it would be very easy on their part to move it far outside the range of feasibility, at least for me.)

@vanishing

This comment has been minimized.

Copy link
Author

commented Nov 17, 2014

@dzhu Thank you dzhu for your work, currently controlling mpd and mpv with myo.
I am wondering how did you figure out the protocol?

@renhyl

This comment has been minimized.

Copy link

commented Nov 17, 2014

thanks dzhu you were right, disconnecting it from everything did the trick. Awesome, thanks man!

@vanishing

This comment has been minimized.

@jwcrawley

This comment has been minimized.

Copy link

commented Nov 18, 2014

If I understand the firmware and the compute platform on the device, they're using the following:

Cortex M4 - cpu (confirmed)
nRF8001 - low power BT (unconfirmed)
MPU9150 9DoF accelerometer (unconfirmed)
8 muscle sensors - ADC's with AgCl sensors (unconfirmed)

If my back of napkin calculations are right, they can do the calculations of basic gestures on chip. Ugly.But they do all processing on the device. Which sucks for us.

@Romkabouter

This comment has been minimized.

Copy link

commented Nov 19, 2014

Hi, I can't seem to get data.
My pygame screenwork and I see some channels filled. But when I make a fist, there seems to be no reaction or highly lagged.
Also, in the classify program, I see no reading on the right hand side, like in the video.

I am running python 2.7.8 and Mac OS Yosimety. Using firmware 0.8.18
What OS are you guys running?

@jwcrawley

This comment has been minimized.

Copy link

commented Nov 19, 2014

Hello!

In my video, I'm using Xubuntu 14.04 with my fork of Dzsu/Myo-raw .

First, lets make sure your firmware version. So, go ahead and plug in the BleGiga USB adapter. Now, you will have to disable the current SDK software. It keeps the data port open so myo_raw cant access it.

Now, once the offical programs are closed, you want to run the following:

python myo_raw.py

That should show you the 8 bars. Each horizontal bar is one of the 8 sensors. If you flex your muscles, you should real realtime muscle activity. You don't have to interpret that data, but just know that you see it realtime.

Next you want to run the gesture creation tool.

python classify_myo.py

Now, you see a screen with 0 through 9 and a green bar through one of them. What this is is how you train the MYO. So first, you want to train a resting gesture. So, you hold 0 when you keep your arm relaxed. Move it around to give the software lots of solutions of what resting is. You want around 1000 samples (the number that goes up when you hold 0).

Now, you can train other gestures. Just decide on what gesture you want to detect. Then, you make that gesture, and then press the # you want associated to that gesture. Say we want a meditation pose of thumb touched to middle finger. Hold your hand that way, and THEN press the number you want associated to that gesture.

When you aren't training (holding down a number, giving it supervised data), you can go from different gesture to see where the green bar goes to. It should follow from gesture to gesture. Of course, the more you have, the more similarity the muscles show. So you may have to do more teaching (hold hand in that position and press appropriate #).

Then, once you are done teaching it, then you can run the final program and interface:

python myo.py

It simply outputs the gesture as a #. So when you are at rest, it outputs a single 0 (assuming your rest is 0). When you change your gesture, it's when this program outputs the number associated to that gesture.

This program can easily be outputted to any number of programs, either in console or to other Python programs.

@jwcrawley

This comment has been minimized.

Copy link

commented Nov 19, 2014

I would also say, that running myo_raw.py should show you the firmware version.

I've found great performance with firmware 0.8.18.2 . It works super smooth on my machine. And obviously, I'm not using the SDK on Linux.

At the moment, if you wish to replicate this work, change your firmware to above. This week's firmware locked users out of raw access, which 0.8.18.2 manual firmware update fixes.

Although, the ideal solution is proper SDK including raw access. Which in December, we all shall have.

@Romkabouter

This comment has been minimized.

Copy link

commented Nov 19, 2014

Hi Josh.

I am using firmware 0.8.18.2, it looks like there is data collected, no errors whatsowever. I have the SDK and Myo Connect disabled.
The pygame window runs fine, but there is no realtime data. That is: when I make a fist, the bars just continue the way there were. Sometimes they change though, I will make a video.

Regardless of having the data in december, I think this is great work and fun above all

@jwcrawley

This comment has been minimized.

Copy link

commented Nov 19, 2014

Then try this.

Connect BlueGiga usb dongle. Shake MYO to connect.

run myo_raw.py

Then if you have MYO on your arm, take it off. Hold the band so the usb port/light is up. The bottom sensor is #1. Now, touch it. That channel should pop up white almost instantly. Now, if you go around the band, you should see a stairstep pattern on the raw output display. It also should refresh at 50 Hz or 50 times per second. There should be absolute minimal lag.

Also on your Mac, I'd completely uninstall the SDK, or drop into terminal and kill -9 the offending programs that are potentially jamming up the serial port.

@Romkabouter

This comment has been minimized.

Copy link

commented Nov 19, 2014

Hey there Josh, here is my (unlisted) video https://www.youtube.com/watch?v=zTNVAIzmY_Y (still processing)
You can see, there is data coming in but really laggy, I will try it on a fresh linux distro when I have time.

@vanishing

This comment has been minimized.

Copy link
Author

commented Nov 19, 2014

@Romkabouter: Make sure your cpufreq is not set to powersaving/conservitive/lowest freq.
Also, do you feel your computer is slow?

@Romkabouter

This comment has been minimized.

Copy link

commented Nov 19, 2014

I have a MacBook Pro 15" retina with 16GB, core i7 2.8 Ghz, no, my computer does not feel slow ;)
Can I set the cpufreq somehow?

I also thought it looks slow, because in the video form Josh the pygame window is much faster.
But I am using everting default settings, no tinkering whatsoever and I presumed my Mac would and should be fast enough. Is the cpufreq a setting in pygame?

@vanishing

This comment has been minimized.

Copy link
Author

commented Nov 19, 2014

@Romkabouter I am not sure how mac handles cpu frequency, but if somehow your cpufreq is locked to say 0.5Ghz, its gonna be slow. Maybe check your power settings...

@Romkabouter

This comment has been minimized.

Copy link

commented Nov 19, 2014

I have set the pygame to FULLSCREEN, then the myo_raw outputs are almost realtime.
The classify program is still a bit of a problem, but I will tinker with it somewhat

@vanishing

This comment has been minimized.

Copy link
Author

commented Dec 5, 2014

I think issue can be closed now, working beautifully now. Especially with the new 1.1.4 firmware!

@vanishing vanishing closed this Dec 5, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.