Go Down

Topic: How to emulate a Dallas (DS2401) (Read 742 times) previous topic - next topic

nucleaireqc

For some post, I found nothing.

I'm asking for help to emulate a DS2401 to replace the serial number with another one.

Someone told me that these possible!

Tank You

Riva

Maybe Mr Google can help you but a search for "arduino 1-wire emulator" gives this as the top result.
Don't PM me for help as I will ignore it.

nucleaireqc

Thank you, I did the test but I just want to change the serial number for another and he found me talking about temperature.

Riva

Thank you, I did the test but I just want to change the serial number for another and he found me talking about temperature.
Not quite following your reply. I think your saying you tested the code (did you remember to set the serial number to the one you need) but not sure what your referring to about temperature. The DS2401 example is not ideal but you can trim it down to it's bare essential. I cannot test the code here at work as I only have one spare Arduino today so cannot generate the serial and test reading it on another Arduino.
Code: [Select]
/*
 *    Example-Code that emulates a DS2401
*/

#include "OneWireHub.h"
#include "DS2401.h"  // Serial Number

constexpr uint8_t pin_led       { 13 };
constexpr uint8_t pin_onewire   { 8 };

auto hub    = OneWireHub(pin_onewire);
auto ds2401 = DS2401( DS2401::family_code, 0x00, 0xA0, 0x01, 0x24, 0xDA, 0x00 );    // Work - Serial Number


void setup()
{
    Serial.begin(115200);
    Serial.println("OneWire-Hub DS2401 Serial Number");

    // Setup OneWire
    hub.attach(ds2401); // always online

    Serial.println("config done");
}

void loop()
{
    // following function must be called periodically
    hub.poll();
}
Don't PM me for help as I will ignore it.

Go Up