danielweidman / pixmob-ir-reverse-engineering

Hacking the PixMob infrared (and now also RF!) protocol to enable control of PixMob wristbands at home.
MIT License
594 stars 42 forks source link

Compile Errors #6

Closed AddumBacon closed 1 year ago

AddumBacon commented 1 year ago

I'm new to Arduino and compiling code, but want to mess with the Pixmob light I got.

I tried to compile/upload the Transmitter sketch and got these errors:

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1099:25: error: missing terminating " character data-action=" ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1100:41: error: stray '#' in program input-entered:ref-selector#inputEntered ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1101:40: error: stray '#' in program tab-selected:ref-selector#tabSelected ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1102:38: error: stray '#' in program focus-list:ref-selector#focusFirstListMember ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1103:13: error: missing terminating " character " ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1150:25: error: missing terminating " character data-action=" ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1151:41: error: stray '#' in program input-entered:ref-selector#inputEntered ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1152:40: error: stray '#' in program tab-selected:ref-selector#tabSelected ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1153:38: error: stray '#' in program focus-list:ref-selector#focusFirstListMember ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1154:13: error: missing terminating " character " ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1637:72: error: stray '#' in program

#include <Arduino.h
                                                                    ^

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1641:72: error: stray '#' in program

#include <IRremote.hpp
                                                                    ^

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1704:182: error: stray '#' in program

incomingString = Serial.readStringUntil('['); // read the incoming byte:
                                                                                                                                                                                  ^

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1704:216: error: stray '#' in program

incomingString = Serial.readStringUntil('['); // read the incoming byte:
                                                                                                                                                                                                                    ^

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1708:182: error: stray '#' in program

incomingString = Serial.readStringUntil(']'); // read the incoming byte:
                                                                                                                                                                                  ^

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1708:216: error: stray '#' in program

incomingString = Serial.readStringUntil(']'); // read the incoming byte:
                                                                                                                                                                                                                    ^

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1725:182: error: stray '#' in program

String newVals = Serial.readStringUntil(',');
                                                                                                                                                                                  ^

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1725:216: error: stray '#' in program

String newVals = Serial.readStringUntil(',');
                                                                                                                                                                                                                    ^

C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1795:12: error: missing terminating ' character

^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1870:12: error: stray '\342' in program You can’t perform that action at this time. ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1870:13: error: stray '\200' in program You can’t perform that action at this time. ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1870:14: error: stray '\231' in program You can’t perform that action at this time. ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:8:1: error: expected unqualified-id before '<' token ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:197:23: error: 'up' does not name a type; did you mean 'u8'? Sign up ^~ u8 C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:411:19: error: 'Automation' does not name a type CI/CD & Automation ^~~~~~~~~~ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:788:25: error: expected unqualified-id before '<' token
{{ message }}
^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1136:97: error: expected unqualified-id before '<' token {{ refName }} ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1176:97: error: expected unqualified-id before '<' token {{ refName }} ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1637:151: error: expected unqualified-id before '<' token #include <Arduino.h ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1641:151: error: expected unqualified-id before '<' token #include <IRremote.hpp ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1654:205: error: expected unqualified-id before '<' token const uint16_t kIrLed = 4; ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1663:142: error: expected unqualified-id before '<' token String incomingString = "; ^ C:\Users\Adam\Desktop\PixMob_Transmitter_Arduino\PixMob_Transmitter_Arduino.ino:1663:185: error: expected unqualified-id before '<' token String incomingString = "; ^ exit status 1 Compilation error: missing terminating " character Any suggestions? Thanks!
danielweidman commented 1 year ago

Hi there! Would you be able to provide large, high resolution screenshot(s) showing the entire Arduino IDE window, including the compile errors?

AddumBacon commented 1 year ago

Actually, I input the code wrong. The code compiles and uploads, but I don't think the light is working

Here is my Arduino setup https://drive.google.com/file/d/1rRBhOav8IWJbG1fFa1jqznPeRbfilMcw/view?usp=sharing

Here is the sketch code

Sketch_code

danielweidman commented 1 year ago

It looks like line 32 is: const uint16_t kIrLed = ~3;

Can you make it just: const uint16_t kIrLed = 3;

AddumBacon commented 1 year ago

I changed it, but it still isn't working. Sketch_code_v2

danielweidman commented 1 year ago

Got it. We may have solved one issue but still need to figure out the rest..

Can you describe exactly what steps you are taking to try and get the bracelet to light up (how you are connecting the Arduino, how you are compiling and uploading the Arduino code, how/when you are running the Python code, etc [plus which files you are using])?

Also:

  1. Which PixMob bracelet/device do you have?
  2. Have you replaced the batteries recently?
  3. What are you using to load the Arduino sketch onto the Arduino? That screenshot doesn't look like the regular Arduino IDE I usually use for Arduino stuff (not that that's necessarily a problem)
  4. Have you changed the serial port variable in the Python code before running it?

I think we'll get this working for you eventually!

AddumBacon commented 1 year ago

Ok, so this is my fault. I haven't installed or worked with python before. I was trying to figure it out, but I'm on Windows and it is a bit confusing.

The PixMob is from The Weeknd show in Seattle on August 25th.

danielweidman commented 1 year ago

Hi there.

No problem, I'm also on Windows and it can be a little annoying but we should be able to get it figured out. There's one way we can do a quick test before doing stuff with Python.

You'd want to first install the official Arduino IDE, install the required IRemote library, take the code from your screenshot and load it onto the Arduino. I'm not sure exactly which of those steps you've done already. You can probably find tutorials about them but I am happy to try and answer questions too.

Also, you will definitely need to replace the batteries for your The Weeknd bracelet from August if you haven't yet. It takes two CR1632 batteries.

danielweidman commented 1 year ago

Once you have the code running on the Arduino, you can test the setup without Python by opening the Serial Monitor window in the Arduino IDE, confirming the baud rate is set correctly to match the code (115200), pasting in the following text (including the trailing comma), and sending it: [35]19121211241212132213221324121123241, (sounds like there's still a few more things to be done before that though)

AddumBacon commented 1 year ago

I did all that and didn't see any info come back on the Serial Monitor

Screenshot 2022-10-31 212934

danielweidman commented 1 year ago

I see.

Two things:

  1. Did you press enter after pasting that text in the Serial Monitor?
  2. You shouldn't expect to get anything back--if the circuit is set up right and the bracelet has power it should react.
AddumBacon commented 1 year ago

Yes, I pressed enter and a light on the board did light up. Looks like I need to get some new batteries. I will let you know how it goes after I do that!

danielweidman commented 1 year ago

Good luck!

AddumBacon commented 1 year ago

Ok, new batteries and it still isn't working.

AddumBacon commented 1 year ago

Nevermind, the batteries weren't in correctly! One has to be upside down.

It works!

20221103_070035_HDR.jpg

danielweidman commented 1 year ago

Awesome!

Is that from pasting the code in the serial monitor, or did you get the stuff with Python set up?

As a side note, from the picture it looks like The Weeknd changed the type of bracelet mid-tour, interesting. I went to an earlier show and got a different model. Interesting!

AddumBacon commented 1 year ago

It was from pasting the code in the serial monitor. I guess figuring out the python code is next.

danielweidman commented 1 year ago

Cool. Biggest things to note may be:

  1. When installing Python, check the box that says "Add Python to PATH" or something similar (if you already installed it and didn't check that box it's possible to do it later but it is just a little harder)
  2. After installing it, open a command prompt window in the python_host folder (of this repo) and run the command "pip install -r requirements.txt"
  3. Edit the line 23 of "demo_single_effect.py" to specify the same COM port as you selected in the Arduino IDE to make that work
  4. Set the variable on line 29 to True Then it should hopefully work when you run the "demo_single_effect.py" file. Then you can use the other multiple effect files and customize them to your liking.

I also won't be mad if you don't want to bother haha

AddumBacon commented 1 year ago

I do want to bother! I am determined to get it working! I will let you know if I run into any issues.

danielweidman commented 1 year ago

Great!

AddumBacon commented 1 year ago

I changed the parameters and ran the code and got back these errors. python error

danielweidman commented 1 year ago

Do you still have the serial monitor open? If so, that may be "taking over" that port and making it so the Python program can't access it.

AddumBacon commented 1 year ago

Legend! That worked. Thanks so much for sticking with me and helping me figure it out!

https://photos.app.goo.gl/Zh8rPKEWw74ZWmPo6

AddumBacon commented 1 year ago

Here are some more pics. I have two of them.

20221103_200259_HDR.jpg20221103_200359.jpg20221103_200405.jpg

danielweidman commented 1 year ago

Yay!