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

Has anyone been able to get the all in one boards from aliexpress to work? #91

Open
samr28 opened this issue May 17, 2018 · 71 comments
Open

Comments

@samr28
Copy link

samr28 commented May 17, 2018

I purchased this board: https://www.aliexpress.com/item/ATMEGA32U4-ESP8266-ESP-12E-ESP12E-Badusb-TF-Micro-SD-Virtual-Keyboard-Development-Board-for-Arduino/32839674193.html?spm=a2g0s.9042311.0.0.R4hbkG

My computer picks it up as an arduino leonardo. So I uploaded the code that allows you to flash the esp board (https://gist.github.com/spacehuhn/b2b7d897550bc07b26da8464fa7f4b36.) Then I tried to use nodemcu to flash it but got the following errors:

Note:Detect serial port changed.
Note:Auto MAP serial port.Port-->COM7

Error:Serial port connect failed, please check it.

Has anyone else been able to get this board or one similar to it working? The bottom says CJMCU-3212 if that helps.

@wilson289296
Copy link

I'd like to know this as well, I haven't been able to get the nodemcu flasher to detect my mac address. I'm a bit concerned as most of the tutorials say the gpio pin is supposed to be disconnected after flashing so it doesn't enter flash mode, but it seems all the pins are permanently soldered on this AIO board. I also haven't been able to find any tutorials involving these aliexpress boards.

@terrabitz
Copy link

There is just one tutorial that I have found for this, but it is entirely in Chinese: https://www.bilibili.com/video/av22645681. If anyone understands it, I would love to figure this out as well. I've been trying to flash just the ESP8266 using a USB-to-TTL device, but haven't had any luck. According to the video, the 4 pins on the right-most side under the "CJMCU" label are Rx, Tx, Vcc, and GND respectively. I've been connecting to those four and then connecting the two circles on the top left, which I presume is to pull CH_PD up. I've been staring at this board for hours, and still haven't been able to make much progress. I'll probably try and pull the board apart once I get some better soldering equipment.

@wilson289296
Copy link

As luck would have it, I speak mandarin. I've watched the video and I think I have the steps down. I'll try to get my hands on that adapter he mentioned and I'll see if it works. In short, though (not having verified my understanding), you grab that adapter, match the holes on the 3212 board to the terminations on the adapter, plug both the badusb and the adapter into your computer, use arduino ide to flash it. But during the entire time you do so, you need to make sure you connect the two silver metallic circles on the upper right side of the TOP of board (this grounds the "firmware flash" pin on the 8266, telling the 8266 that it's supposed to be in fw flashing mode) and hold the white button on the board for the entire duration of the flash. He didn't mention what he used, but I'm assuming it's just the standard nodemcu flasher according to this project's documentation. See if you guys can work it out; if you need more translated details, let me know and I'll give line by line translation. Good luck to all!

@samr28
Copy link
Author

samr28 commented May 29, 2018

So I was able to get the esp flasher uploaded to the arduino with program_pin and enable_pin at the defaults (program: 12 & enable 13). I then connected the two metal circles on the board, pressed the reset button and while still connecting the metal circles, I tried to flash with nodemcu. It looked promising at the beginning but after waiting a few minutes, I gave up and checked the logs. When I hold down the white button, the device turns off so I don't think that part is right. Maybe you need to press it at a specific time?

Logs:

Note:Serial port disconnected.
Warning:Serial port closed by user.
Note:Detect serial port changed.
Note:Auto MAP serial port.Port-->COM7

@pjaakko
Copy link

pjaakko commented Jun 3, 2018

It's nice to find out, that I'm not only one trying to solve the mystery of this CJMCU-3212 badusb device :-)

Has anyone managed to figure out how to use the default firmware? When I powered the device, it creates WLAN AP with SSID "AI-THINKER_" without password. ESP assigns IP address from 192.168.4.0/24 network but there isn't http server or anything running.

@samr28
Copy link
Author

samr28 commented Jun 4, 2018

Mine is the same as @pjaakko. I think we need to figure out how to flash the ESP to get the http server running. From what I understand, to do this, we need to get the leonardo to run the flasher arduino sketch which basically just forwards everything to the ESP board. Then we can put the real arduino sketch on it and we should be good.

I also tried an IP scanner to see if it was just running on a different ip or something but I didn't find anything running so I think the http server is just not running.

Maybe @wilson289296 can re check the video to see what exactly we should be doing for flashing. I tried connecting the two metallic circles but when I press and hold the button (which appears to be a reset button), the device will not turn on. So maybe it was some sort of miscommunication or translation error? I'm not quite sure.

@wilson289296
Copy link

I'll try to get a line-by-line translation of the video done by the end of this week, sorry for the slow progress.

@SmartContractsAgency
Copy link

@wilson289296
thank you
we are waiting)

I hoped that we can flash esp without any additional adapters.

also I think that we can check number of pins connected to esp and atmega
program_pin and enable_pin

maybe it is not 12/13
can we check with multimeter?

@pjaakko
Copy link

pjaakko commented Jun 29, 2018

We seems to be more or less stuck here. Is there any other community, forum or such to discuss about this aliexpress device?

@puckk
Copy link

puckk commented Jul 19, 2018

@wilson289296 some news?

@samr28
Copy link
Author

samr28 commented Jul 27, 2018

I went through that video again and found some info on the pins: https://i.imgur.com/MgTCnhV.jpg. But other than that, no progress :(

@ghost
Copy link

ghost commented Aug 7, 2018

Hello guys, im new at this tread. So do we have anything new?
@wilson289296 did you translated the video?

@ghost
Copy link

ghost commented Aug 7, 2018

Iam trying to get contact with the video creator at bilibili.

@ghost
Copy link

ghost commented Aug 7, 2018

For god sake!!!. I can't send a message to the bilibili guy cus i don't have level in the plataform.

@ghost
Copy link

ghost commented Aug 7, 2018

Anyone, try to contact this guy, https://space.bilibili.com/39602674/#/, he is creator of the only vídeo in the world explaning how to configure the CJMCU-3212. I don't know how do i get this "trustness level" to contact someone at bilibili.

@puckk
Copy link

puckk commented Aug 7, 2018

Hi, I was able to make it work! I made a guide for you

https://github.com/puckk/CJMCU-3212

@ghost
Copy link

ghost commented Aug 7, 2018

i lv you man

@AieCaPique
Copy link

Hello
Thank you puckk for your tutorial :)
It works great for me with the flash version for windows
Can you get the micro SD slot to work?

@puckk
Copy link

puckk commented Aug 20, 2018

Yes, the SD card worked with the examples of the Arduino IDE.

@AieCaPique
Copy link

Puckk could you add to your tutorial the method to operate the SD slot ?
thank you very much

@FietsenRijder
Copy link

Hello,
I'm planning on buying one of these. Would you recommend them? And @puckk thanks already for your tutorial, but is there a way on looping the two circles without that special wire or can you just do it with something else?
Thank you

@samr28
Copy link
Author

samr28 commented Aug 27, 2018

@FietsenRijder You should just need to short those two pads together. Any object that conducts electricity (like a paperclip) should work.

@FietsenRijder
Copy link

FietsenRijder commented Aug 28, 2018

@samr28 Thanks for your quick respond do you recommend it and does it work? @puckk @ AieCaPique

@AieCaPique
Copy link

yes for me it works very well
I just need to make conf for the micro SD is supported

@FietsenRijder
Copy link

@puckk So the thing is delivered but I don't understand how to flash it I did step 1 of your tutorial and when i plug the usb in a red light on top turns on but I don't understand step 2. First how to install esptool? And what to do then i'm new so can you be a little more specific?
Thank You

@samr28
Copy link
Author

samr28 commented Sep 12, 2018

@FietsenRijder What OS is your computer? You need to install python and then follow the instructions here: https://github.com/espressif/esptool#installation--dependencies

@FietsenRijder
Copy link

@samr28 I'm running the latest windows 10. I do not understand how to install. @AieCaPique @puckk What sd card are you using and does te 6 pin thing that comes with it work to bridge?
And @puckk do you have to bridge first and then plug in or how did you do that, I do not understand it at all.

Please help me

FietsenRijder

@riogesulgon
Copy link

riogesulgon commented Sep 24, 2018

Hi,
Please help to troubleshoot the steps I am using. There seems to be something I am missing.

  1. I have uploaded step1.ino using the Leonardo board. It seems that the program is setting the following pins:
  • ENABLE to high
  • PROGRAM to low
  1. Removed the device from usb socket and soldered wires to the top two right pads so i can easily join and remove the ends of the wires.
  2. Joined the wires and inserted the device into the usb port and ran the command.
    However I am getting the following error message:
esptool.py.exe --trace   --baud 115200 --port COM9 write_flash 0x00000 /dev/esp8266_wifi_duck_4mb.bin --flash_size 4MB --flash_mode dio --flash_freq 40m
esptool.py v2.5.0
Serial port COM9
Connecting...TRACE +0.000 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU
TRACE +0.000 Write 46 bytes:
    c000082400000000 0007071220555555 | ...$........ UUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    5555555555555555 5555555555c0     | UUUUUUUUUUUUU.
TRACE +0.103 Timed out waiting for packet header
.TRACE +0.054 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
    0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
    5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
    55555555                          | UUUU

20180925_010119

I am running this on Windows 10 by the way and will try to run on Mac OS later as the interaction between serial port and esptool might not be working properly. Appreciate any help you might provide in the meanwhile. Thanks.

@samr28
Copy link
Author

samr28 commented Sep 24, 2018

@riogesulgon I had the same issue with esptool. To fix it, I used nodemcu which worked the first try.

@riogesulgon
Copy link

riogesulgon commented Sep 25, 2018

Thanks @samr28! I was able to flash the firmware using the nodemcu flasher (https://github.com/nodemcu/nodemcu-flasher). My board is now working properly.

@camilitox
Copy link

@puckk Your tutorial was amazing, do you have some script to use de SD card simultaneously with the WiFi?

@rl34075
Copy link

rl34075 commented May 15, 2019 via email

@TechieRuss
Copy link

On the board that I got, the SD card is wired to the atmega32u4 not to the esp8266. this might make it more difficult to move files to it from the 8266.

@rl34075
Copy link

rl34075 commented May 15, 2019 via email

@camilitox
Copy link

https://github.com/joelsernamoreno/badusb_sd_wifi?files=1 ... This can read scripts from sd ... But uses other language script

@blackecho101
Copy link

We need to find a way to merge the SD capability of badusb_sd_wifi with the features and ducky script compatibility of this amazing project! I ordered my board from aliexpress and it arrived in 12 days! I hope there is more activity around this board soon!

@kryptonut
Copy link

It's a great little board. Question, does it just read raw duckyscript in the interpreter, or does it still need an inject.bin of sorts? Might see if I can cobble something together to get the SD card working too - no promises though, I'm not an actual developer.

@rl34075
Copy link

rl34075 commented Jul 29, 2019 via email

@rl34075
Copy link

rl34075 commented Jul 29, 2019 via email

@rl34075
Copy link

rl34075 commented Jul 29, 2019 via email

@kryptonut
Copy link

Mine is flashed, and I can upload scripts, run live scripts, etc.

I've had no success putting scripts on the SD card and from what I've seen in the code, there's no reference to any sort of SD libraries or SD card handling.

@rl34075
Copy link

rl34075 commented Jul 30, 2019 via email

@vtontodonato-c
Copy link

I need to flash esp8266 on the CJMCU-3212 via OTA or access the esp8266 via ARDUINO IDE to develop my own software NOT duck.

Is anybody trying something as this?

Can I flash my arduino code directly?

thanks

@chepo92
Copy link

chepo92 commented Nov 20, 2019

As I said before the SD is wired to the Atmega, so you upload scripts to esp8266 then send them via serial to Atmega then it has to write to sd

@neoskyriper
Copy link

Pour ma part je n'arrive plus a le flasher avec un .bin avec nodemcu-flasher-master ESP8266Flasher.exe
je suis désespéré je ne sais plus quoi faire
si vous avez une solution s'il vous plait merci

@sebastienPoussard
Copy link

adter a few months, i suceeded to make it work, it seems I needed to to it with Windows.
With my Linux laptop it didn't worked.
Anyway, I'm now facing a new issue, when i type text in the web server, it is mappy to different code on the remote host (azerty) @AieCaPique any ideas ?

@cnu77
Copy link

cnu77 commented Jan 30, 2020

Hi, I was able to make it work! I made a guide for you

https://github.com/puckk/CJMCU-3212

I tried, but not working.

I tried 3 different ways, ending in the same loop. Tried joining the 2 pins as shown in your pic, same issues.

  1. esptool.py --> serial.serialutil.SerialTimeoutException: Write timeout
  2. Arduino IDE --> serial.serialutil.SerialTimeoutException: Write timeout the selected serial port serial.serialutil.SerialTimeoutException: Write timeout does not exist or your board is not connected
  3. NodeMCU Flash --> Waiting MAC

I am not sure, if...

  1. GPIO0 is grounded or not (Or, by default, it is grounded)
  2. Do I need to flash ESP8266 with firmware? Is it a 'must'?

Any suggestions, please?

@Xentraxx
Copy link

Xentraxx commented Feb 6, 2020

I got WiFiDucky working but as I'd like to use different keyboard mappings I'd like to use the successor WiFiDuck as it supports different keyboard types.
@rl34075 You mentioned that you changed the script to use the pt-BR keyboard. Could you explain or provide a resource on how to use a qwertz keyboard with WiFiDucky for example?

@cnu77
Copy link

cnu77 commented Feb 6, 2020

Now, I tried this video https://www.youtube.com/watch?v=G-Z2rf_AN-c

I followed the steps.

Flash ATMEGA32U4, using Step1.ino file
Flash ESP8266 using esp8266_flasher.exe and esp8266_wifi_duck_4mb.bin as bin file. Held a jumper cable to the 2 circles, pushed it to USB. Connected to the USB. Did not take the cable out. Click on Download on the flasher and uploaded and finally said 'leaving...'
Now, I can connect to the WiFi Duck with password quackquack.

But, I cannot run the script. Nothing happens.

When I checked in the Serial monitor, I saw some wierd characters.

So, in the Step1.ino I changed the baud rate as below:

Serial.begin(115200) --> Junk
Serial.begin(57600) --> Print the commands in Serial Monitor, but nothing gets executed
Serial.begin(9600) --> Nothing happens

Any idea?

Also, even the baud rate is 57600, I can see the output in serial monitor, only when I select 115200 baud. Why is it so?

@cnu77
Copy link

cnu77 commented Feb 10, 2020

Sorry, its fine now. This is what happens with you do not have any idea about what you are doing.

After spending some time in going through the files that I have, I compared the .ino files I uploaded into ATMEGA32U4 with the actual script from the site, I found that what I uploaded is just a sample script which just prints whatever you send from 192.168.4.1.

Now, I uploaded the correct script and working like a charm.

@ghost
Copy link

ghost commented Jun 11, 2020

Has anybody been able to get everything working?

@samr28
Copy link
Author

samr28 commented Jun 11, 2020

Has anybody been able to get everything working?

Yep, check out the guide puckk made https://github.com/puckk/CJMCU-3212

@fluxxion82
Copy link

fluxxion82 commented Jul 16, 2020

Has anyone been able to flash the esp8266 via esptool on a mac? The only time I can get it to write anything to the chip is right after pressing the reset button, but as soon as it's done resetting, the esptool quits. I have a lone esp8266 chip that I can write to, but I can't seem to get things to work on this cjmcu board. I found one repo where they were using a modified esptool it looked like, but I couldn't get that to work either. I don't really want to find a windows machine to use the nodemcu flassher tool.
-EDIT
I rewatched puckk's tutorial and he mentions the issues with the esptool and some of the things said in this thread. I'm curious what nodemcu flasher is doing, because it's still using the programmer code of sending the serial data from the arduino uart to the esp uart that we have to install first. And what is this reset button doing that's allowing the esptool to successfully send data? Can we prolong this state somehow, maybe?
I checked all of the voltages at each pin to check that they matched my lone esp8266 chip and everything looked correct. Then I tried to flash the fw directly to the esp in the exact same way I do the lone chip, but that still didn't work. I can see the esp's led flash when using the esptool, but I don't see it flash with the nodemcu flash tool. Anyways, would love to be able to use the esptool if anyone has figured it out.

@chepo92
Copy link

chepo92 commented Jul 17, 2020

Has anyone been able to flash the esp8266 via esptool on a mac? The only time I can get it to write anything to the chip is right after pressing the reset button, but as soon as it's done resetting, the esptool quits. I have a lone esp8266 chip that I can write to, but I can't seem to get things to work on this cjmcu board. I found one repo where they were using a modified esptool it looked like, but I couldn't get that to work either. I don't really want to find a windows machine to use the nodemcu flassher tool.
-EDIT
I rewatched puckk's tutorial and he mentions the issues with the esptool and some of the things said in this thread. I'm curious what nodemcu flasher is doing, because it's still using the programmer code of sending the serial data from the arduino uart to the esp uart that we have to install first. And what is this reset button doing that's allowing the esptool to successfully send data? Can we prolong this state somehow, maybe?
I checked all of the voltages at each pin to check that they matched my lone esp8266 chip and everything looked correct. Then I tried to flash the fw directly to the esp in the exact same way I do the lone chip, but that still didn't work. I can see the esp's led flash when using the esptool, but I don't see it flash with the nodemcu flash tool. Anyways, would love to be able to use the esptool if anyone has figured it out.

Did you enable verbose mode to check when it is failing?
Have you tried other programmers/gui?

@fluxxion82
Copy link

Has anyone been able to flash the esp8266 via esptool on a mac?

Did you enable verbose mode to check when it is failing?
Have you tried other programmers/gui?

I did turn on the trace mode before. I was mistaken - after relooking at the output, it looks like there were some failures when it was trying to write during the reset time. It writes some bytes, reads a byte, which is then declared invalid data. So there does seem to be some communication happening. When it was trying to update the esp8266 without hitting the reset button, the data would attempt to be written, but then timeout while waiting for a packet header.

I did get to a windows box and was able to flash the esp with nodemcu, so I'm able to make some movement working with the device. It would definitely be more ideal if I could get esptool to work so I don't have to jump around workstations.

I skimmed over the nodemcu code and started to get an understanding of how they put it together, but I need to sit down and really peruse through it and figure out what they're doing right. I couldn't even get the esp to flash by directing wiring up to the chip and using esptool, which I thought was strange.

@chepo92
Copy link

chepo92 commented Jul 18, 2020

@fluxxion82
Just twice checking:
did you upload the sketch to the avr chip? (step1)
if you open a COM terminal, do you see the message of the bootloader from the ESP when reset?

@fluxxion82
Copy link

@fluxxion82
Just twice checking:
did you upload the sketch to the avr chip? (step1)

yes.

if you open a COM terminal, do you see the message of the bootloader from the ESP when reset?

no, I don't think I'm seeing anything from the ESP bootloader when reset. I've been referring to the output from the esptool via the --trace option, from which I can see the data being written and read (the ack or whatever that is being read is invalid). I hooked up wires to the cjmcu uart pins and could see the hex output of the data written that also shows up in the esptool trace, and don't see anything if I reset the cjmcu board.

@FrankLaterza
Copy link

Okay, I read everything, but I haven't seen anyone get the ESP-8266 wifi code to upload using the Arduino IDE. I want to do a project similar to Mr. puckk, but I don't want to export as binary then flash it with ESP8266 flasher every time I want to make a change. Has anyone been able to do this or is there a programmer I need to use?

@Makswell77713
Copy link

Makswell77713 commented Oct 8, 2023

Hello, everyone! Has anyone fixed the issue with CJMCU-3212? To flash it, I used this guide - https://github.com/puckk/CJMCU-3212. After shorting the contacts with a jumper and connecting it to my MacBook, the blue light stopped flashing. I then tried to flash it using the command 'esptool.py --trace --baud 115200 --port /dev/cu.usbmodem2101 write_flash 0x00000 /Users/apple/Projects/esp8266_wifi_duck_4mb.bin --flash_size 4MB --flash_mode dio --flash_freq 40m' and received this error.

TRACE +0.000 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.104 No serial data received.
.TRACE +0.052 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
55555555 | UUUU
TRACE +0.000 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.100 No serial data received.
.TRACE +0.052 command op=0x08 data len=36 wait_response=1 timeout=0.100 data=
0707122055555555 5555555555555555 | ... UUUUUUUUUUUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
55555555 | UUUU
TRACE +0.000 Write 46 bytes:
c000082400000000 0007071220555555 | ...$........ UUU
5555555555555555 5555555555555555 | UUUUUUUUUUUUUUUU
5555555555555555 5555555555c0 | UUUUUUUUUUUUU.
TRACE +0.102 No serial data received.
.

A fatal error occurred: Failed to connect to Espressif device: No serial data received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests