Friday, August 25, 2017

Remotely rename computer in windows domain.

run from cli:

netdom renamecomputer old_name  /newname:new_name  /userd:domain_admin_login  /passwordd:domain_admin_pwd

computer will be renamed after restart. If add /reboot:10 computer will be forsibly rebooted after 10 seconds.

Wednesday, August 9, 2017

How to unbrick Arduino Pro Micro 3v3 8MHz version

Recently a made a project with 3v3 version of arduino  pro micro. And accidentally uploaded sketch for arduino Micro. After that I got bricked arduino board. It was not recognized by windows, there was problems with usb enumeration(also "device descriptor request failed", "unrecognized device" etc.).
It seems that problem was with wrong bootloader, so I took my USBasp, connected it to arduino board. From arduino IDE selected right board - "SparkFun Pro Micro", selected processor Atmega32U4 (3.3V 8MHz) and tried to burn bootloader. Got an error - "verification error, first mismatch at byte 0x0000 0xce != 0xfe".
Then I tried to flash bootloader from 5V 16Mhz version, and it was uploaded successfully, but surely because of wrong crystal settings board was still bricked("usb enumeration problems").
So, solution for this is very easy, all you need is swap 3v3 and 5v bootloaders and load bootloader as it was 5v version.

To do this go to:
c:\Users\<username>\AppData\Roaming\Arduino15\packages\SparkFun\hardware\avr\1.1.6\bootloaders\caterina\

and find files Caterina-promicro8.hex and  Caterina-promicro16.hex then rename these files so Caterina-promicro8 -> Caterina-promicro16,  
Caterina-promicro16 -> Caterina-promicro8

after that go to arduino IDE, select SparkFun Pro Micro board,
select Processor Atmega32U4 (5V 16MHz),
select programmer "USBasp",
connect board to programmer and hit "Burn bootloader"

After that board was functional again.
Do not forget to rename bootloader files back to original.
If you do not have USBasp you can use another arduino board as programmer,but do not forget that levels must be the same 5v or 3v3 or use level shifters.