Electronics > Projects, Designs, and Technical Stuff
Read/write eeprom from USB Wifi dongle with the Realtec RTL8187 chip
(1/3) > >>
tru3533:
Hello,
Needed to change the MAC address on my Wifi dongle equipped with the Realtec RTL8187 chip,
so I opened it up and desoldered the eeprom 93C46.
Was easy to read and change the MAC address @ 0Eh - 13h

I would like to change the MAC address many times so I was thinking it could be done via software.
Datasheet for the Realtec wifi chip RTL8187 says in chapter 9:
Software can read and write to the EEprom using "bit-bang" accesses via 9346CR register.
Look at the included datasheet   RTL8187.pdf (754.83 kB - downloaded 390 times.)

This is something I would really like to learn.
How would you approach such a problem?
What software/programming tools would you use?

Any tips getting me on the right path is highly welcome :-)

Regards, Tom
 

magic:
Your datasheet doesn't say how to access EEPROM over USB.

However, there is a Linux driver for RTL8187 which contains definitions of all the necessary magic numbers. Beware that it seems to address the EEPROM in words rather than bytes, so 0x7 instead of 0xE. Once you know how to talk to the chip, write a utility using libusb.

And since you aren't going to bother with any of it, just buy a SOIC test clip to reprogram all your cards without soldering :-DD
tru3533:
Thank you Magic,

No no, I'm on a roll here   8) I will not lay down because of some software challenges.  ;D

I looked for the libusb and also found the OpenUSB that takes a fork of the libusb 1.0 project
Not sure what to go for.

Good tip to look into the Linux USB driver

Using Python the PyUSB 1.0 also looks interesting
Seems like a straightforward way to access the USB



--- Code: ---import usb.core
import usb.util

# find our device
dev = usb.core.find(idVendor=0xfffe, idProduct=0x0001)

# was it found?
if dev is None:
    raise ValueError('Device not found')

# set the active configuration. With no arguments, the first
# configuration will be the active one
dev.set_configuration()

# get an endpoint instance
cfg = dev.get_active_configuration()
intf = cfg[(0,0)]

ep = usb.util.find_descriptor(
    intf,
    # match the first OUT endpoint
    custom_match = \
    lambda e: \
        usb.util.endpoint_direction(e.bEndpointAddress) == \
        usb.util.ENDPOINT_OUT)

assert ep is not None

# write the data
ep.write('test')

--- End code ---

magic:
Yes, that python library looks like the kind of thing I had in mind.
It will probably be the control endpoint this time, though. Again, see how the rtl818x driver does it.

By the way, you know that you can temporarily change the MAC address by software without messing with the card itself, right?
tru3533:
Yes, I have been down that road already, changing the registry and setting the driver Network MAC address in device manager.
MAC address is changed but my pesky license checker is not buying it.   ;D
Navigation
Message Index
Next page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod