Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-30 Thread 'Johan Lind' via BeagleBoard
I have now been able to write to the eeprom.
First I wrote a file with 30 bytes of data, then I calculated the crc16 
(pol 8005) and inverted the result bit wise.
int main(void)
{
   uint8_t buf[32];
   uint16_t crc;
   std::ofstream out_file;

   crc = 0;
   for (int idx = 0; idx < 30; idx++)
   {
  buf[idx] = idx + 49; // fill buffer with data
  crc = crc16_byte_8005(crc, buf[idx]);
   }
   buf[30] = ~((uint8_t)((crc & 0x00FF)));
   buf[31] = ~((uint8_t)((crc & 0xFF00) >> 8));

   out_file.open ("/home/debian/test/c_file");
   if(out_file.is_open())
   {
  out_file.write((char *)(), 32);
  out_file.close();
   }
   return 0;
}
The final file I could both write and read to eeprom.
debian@beaglebone:~/test$ cat c_file > 
/sys/bus/w1/devices/23-02eddd9b/eeprom
debian@beaglebone:~/test$ cat /sys/bus/w1/devices/23-02eddd9b/eeprom | 
hexdump
000 3231 3433 3635 3837 3a39 3c3b 3e3d 403f
010 4241 4443 4645 4847 4a49 4c4b 4e4d 63ba
020        
*
200


So to use the eeprom without crc on every page the driver needs to be 
re-compiled with other options.


onsdag 30 september 2020 kl. 14:40:40 UTC+2 skrev Johan Lind:

> I think we're getting closer to the truth now.
>
> Reading the source code and especially this section is interesting:
> #ifdef CONFIG_W1_SLAVE_DS2433_CRC 
> 
>  
>   /* can only write full blocks in cached mode */ 
>   if ((off 
> 
>  
> & W1_PAGE_MASK 
> )
>  
> || (count 
> 
>  
> & W1_PAGE_MASK 
> ))
>  
> {
> dev_err 
> (>dev,
>  
> "invalid offset/count off=%d cnt=%zd\n", (int)off, count); 
> return -EINVAL 
> ;
>  
> } 
>   /* make sure the block CRCs are valid */ 
>   for (idx 
> 
>  
> = 0; idx 
> 
>  
> < count 
> ;
>  
> idx 
> 
>  
> += W1_PAGE_SIZE 
> )
>  
> { 
>  if (crc16 
> 
> (CRC16_INIT 
> ,
>  
>  
> 
> [idx 
> ],
>  
> W1_PAGE_SIZE 
> )
>  
> != CRC16_VALID 
> )
>  
> { 
> dev_err 
> (>dev,
>  
> "bad CRC at offset %d\n", (int)off); 
> return -EINVAL 
> 
> ; 
>  } } 
>
> If I try to run these commands:
> echo "12345678901234567890123456789012" > 
> /sys/bus/w1/devices/23-02eddd9b/eeprom
> echo "1234567890123456789012345678901" > 
> /sys/bus/w1/devices/23-02eddd9b/eeprom
> dmesg | tail
> [80808.027040] w1_slave_driver 23-02eddd9b: invalid offset/count off=0 
> cnt=33
> [80829.659168] w1_slave_driver 23-02eddd9b: bad CRC at offset 0
>  
> I removed some output from my terminal and focused on these lines.
> The errors found using dmesg looks to come from this section in the 
> driver. If I send 33 bytes I get the invalid offset/count error and with 32 
> bytes I pass this section and get crc error.
> Now I have to try to manually calculating the crc and see where it takes 
> me.
>  
> onsdag 30 september 2020 kl. 13:16:09 UTC+2 skrev Sven Norinder:
>
>> Maybe kernel must have crc enabled for 2433 writes?
>> Last line implies something about writes.
>>
>> config W1_SLAVE_DS2433
>> tristate "4kb EEPROM family support (DS2433)"
>> help
>>   Say Y here if you want to use a 1-wire
>>   4kb EEPROM family device (DS2433).
>>
>> config W1_SLAVE_DS2433_CRC
>> bool "Protect DS2433 data with a CRC16"
>> depends on W1_SLAVE_DS2433
>> select CRC16
>> help
>>   Say Y here to protect DS2433 data with a CRC16.
>>   Each block has 30 bytes of data and a two byte CRC16.
>>  

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-30 Thread 'Johan Lind' via BeagleBoard
I think we're getting closer to the truth now.

Reading the source code and especially this section is interesting:
#ifdef CONFIG_W1_SLAVE_DS2433_CRC 

 
  /* can only write full blocks in cached mode */ 
  if ((off 

 
& W1_PAGE_MASK 
)
 
|| (count 

 
& W1_PAGE_MASK 
))
 
{
dev_err 
(>dev,
 
"invalid offset/count off=%d cnt=%zd\n", (int)off, count); 
return -EINVAL 
;
 
} 
  /* make sure the block CRCs are valid */ 
  for (idx 

 
= 0; idx 

 
< count 
;
 
idx 

 
+= W1_PAGE_SIZE 
)
 
{ 
 if (crc16 

(CRC16_INIT 
,
 
 

[idx 
],
 
W1_PAGE_SIZE 
)
 
!= CRC16_VALID 
)
 
{ 
dev_err 
(>dev,
 
"bad CRC at offset %d\n", (int)off); 
return -EINVAL 

; 
 } } 

If I try to run these commands:
echo "12345678901234567890123456789012" > 
/sys/bus/w1/devices/23-02eddd9b/eeprom
echo "1234567890123456789012345678901" > 
/sys/bus/w1/devices/23-02eddd9b/eeprom
dmesg | tail
[80808.027040] w1_slave_driver 23-02eddd9b: invalid offset/count off=0 
cnt=33
[80829.659168] w1_slave_driver 23-02eddd9b: bad CRC at offset 0
 
I removed some output from my terminal and focused on these lines.
The errors found using dmesg looks to come from this section in the driver. 
If I send 33 bytes I get the invalid offset/count error and with 32 bytes I 
pass this section and get crc error.
Now I have to try to manually calculating the crc and see where it takes me.
 
onsdag 30 september 2020 kl. 13:16:09 UTC+2 skrev Sven Norinder:

> Maybe kernel must have crc enabled for 2433 writes?
> Last line implies something about writes.
>
> config W1_SLAVE_DS2433
> tristate "4kb EEPROM family support (DS2433)"
> help
>   Say Y here if you want to use a 1-wire
>   4kb EEPROM family device (DS2433).
>
> config W1_SLAVE_DS2433_CRC
> bool "Protect DS2433 data with a CRC16"
> depends on W1_SLAVE_DS2433
> select CRC16
> help
>   Say Y here to protect DS2433 data with a CRC16.
>   Each block has 30 bytes of data and a two byte CRC16.
>   Full block writes are only allowed if the CRC is valid.
>
> /Sven
>
> onsdag 30 september 2020 kl. 10:56:55 UTC+2 skrev Johan Lind:
>
>> Well, I have an i2c memory on the same board and to read and write to 
>> that I can use the following commands:
>> write
>> cat data.eeprom > /sys/bus/i2c/devices/2-0057/eeprom
>> read
>> cat /sys/bus/i2c/devices/2-0057/eeprom | hexdump
>>
>> I did try your suggestion of using dd but I could not get it to work.
>> root@beaglebone:/home/debian# dd if=/dev/zero 
>> of=/sys/bus/w1/devices/23-02eddd9b/eeprom bs=32
>> dd: error writing '/sys/bus/w1/devices/23-02eddd9b/eeprom': Invalid 
>> argument
>> 1+0 records in
>> 0+0 records out
>> 0 bytes copied, 0.0159578 s, 0.0 kB/s
>> root@beaglebone:/home/debian# 
>>
>> As the eeprom is written to contain data on another device, so I thought 
>> it would be enough to use /dev/zero as input.
>> Reading out data show no change of content (as expected consider the 
>> output from dd)
>> cat /sys/bus/w1/devices/23-02eddd9b/eeprom | hexdump
>> 000 00ff 55aa  00ff 55aa  00ff 55aa  00ff 55aa
>> onsdag 30 september 2020 kl. 07:15:53 UTC+2 skrev Sven Norinder:
>>
>>> The eeprom probably is a device, not a filesystem.
>>> Use dd instead.
>>> /Sven
>>>
>>> tisdag 29 september 2020 kl. 17:59:14 UTC+2 skrev Johan Lind:
>>>
 I tried with only a short (6 bytes) string but still the same 

Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-30 Thread Sven Norinder
Maybe kernel must have crc enabled for 2433 writes?
Last line implies something about writes.

config W1_SLAVE_DS2433
tristate "4kb EEPROM family support (DS2433)"
help
  Say Y here if you want to use a 1-wire
  4kb EEPROM family device (DS2433).

config W1_SLAVE_DS2433_CRC
bool "Protect DS2433 data with a CRC16"
depends on W1_SLAVE_DS2433
select CRC16
help
  Say Y here to protect DS2433 data with a CRC16.
  Each block has 30 bytes of data and a two byte CRC16.
  Full block writes are only allowed if the CRC is valid.

/Sven

onsdag 30 september 2020 kl. 10:56:55 UTC+2 skrev Johan Lind:

> Well, I have an i2c memory on the same board and to read and write to that 
> I can use the following commands:
> write
> cat data.eeprom > /sys/bus/i2c/devices/2-0057/eeprom
> read
> cat /sys/bus/i2c/devices/2-0057/eeprom | hexdump
>
> I did try your suggestion of using dd but I could not get it to work.
> root@beaglebone:/home/debian# dd if=/dev/zero 
> of=/sys/bus/w1/devices/23-02eddd9b/eeprom bs=32
> dd: error writing '/sys/bus/w1/devices/23-02eddd9b/eeprom': Invalid 
> argument
> 1+0 records in
> 0+0 records out
> 0 bytes copied, 0.0159578 s, 0.0 kB/s
> root@beaglebone:/home/debian# 
>
> As the eeprom is written to contain data on another device, so I thought 
> it would be enough to use /dev/zero as input.
> Reading out data show no change of content (as expected consider the 
> output from dd)
> cat /sys/bus/w1/devices/23-02eddd9b/eeprom | hexdump
> 000 00ff 55aa  00ff 55aa  00ff 55aa  00ff 55aa
> onsdag 30 september 2020 kl. 07:15:53 UTC+2 skrev Sven Norinder:
>
>> The eeprom probably is a device, not a filesystem.
>> Use dd instead.
>> /Sven
>>
>> tisdag 29 september 2020 kl. 17:59:14 UTC+2 skrev Johan Lind:
>>
>>> I tried with only a short (6 bytes) string but still the same behaviour.
>>>
>>>
>>> tisdag 29 september 2020 kl. 17:45:47 UTC+2 skrev 
>>> robert.sty...@gmail.com:
>>>
 I suggest trying to write less than 32 bytes (the dmesg implies 
 something wrong with offset or count) -- create a file of less than 32 
 bytes and copy to eeprom
 cd ~
 echo "1234567890" > file10
 cp -T file10 /sys/bus/w1/devices/23-02eddd9b/eeprom

 In the data sheet you need a much smaller R[PU] to write than read
 https://datasheets.maximintegrated.com/en/ds/DS2433.pdf

 On Tuesday, 29 September 2020 at 16:03:48 UTC+1 RobertCNelson wrote:

> On Tue, Sep 29, 2020 at 9:55 AM 'Johan Lind' via BeagleBoard 
>  wrote: 
> > 
> > Yes, it does still show eeprom 
> > 
> > debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b 
> > driver eeprom id name power subsystem uevent 
> > debian@beaglebone:~$ ls /sys/bus/w1/devices/ 
> > 23-02eddd9b w1_bus_master1 
> > debian@beaglebone:~$ 
> > debian@beaglebone:~$ ls -al /sys/bus/w1/devices/23-02eddd9b/ 
> > total 0 
> > drwxrwxr-x 3 root gpio 0 Sep 29 14:00 . 
> > drwxrwxr-x 4 root gpio 0 Sep 29 14:00 .. 
> > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 driver -> 
> ../../../bus/w1/drivers/w1_slave_driver 
> > -rw-rw-r-- 1 root gpio 512 Sep 29 14:07 eeprom 
>
> Side note, you don't' have to be root, the "gpio" group is the default 
> for debian.. 
>
> > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 id 
> > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 name 
> > drwxrwxr-x 2 root gpio 0 Sep 29 14:00 power 
> > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 subsystem -> ../../../bus/w1 
> > -rw-rw-r-- 1 root gpio 4096 Sep 29 14:00 uevent 
> > debian@beaglebone:~$ 
>
> not sure why you can't write... 
>
> Regards, 
>
> -- 
> Robert Nelson 
> https://rcn-ee.com/ 
>


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/e73a99a5-1f00-4d62-9dea-016856f8f1d3n%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-30 Thread 'Johan Lind' via BeagleBoard
Well, I have an i2c memory on the same board and to read and write to that 
I can use the following commands:
write
cat data.eeprom > /sys/bus/i2c/devices/2-0057/eeprom
read
cat /sys/bus/i2c/devices/2-0057/eeprom | hexdump

I did try your suggestion of using dd but I could not get it to work.
root@beaglebone:/home/debian# dd if=/dev/zero 
of=/sys/bus/w1/devices/23-02eddd9b/eeprom bs=32
dd: error writing '/sys/bus/w1/devices/23-02eddd9b/eeprom': Invalid 
argument
1+0 records in
0+0 records out
0 bytes copied, 0.0159578 s, 0.0 kB/s
root@beaglebone:/home/debian# 

As the eeprom is written to contain data on another device, so I thought it 
would be enough to use /dev/zero as input.
Reading out data show no change of content (as expected consider the output 
from dd)
cat /sys/bus/w1/devices/23-02eddd9b/eeprom | hexdump
000 00ff 55aa  00ff 55aa  00ff 55aa  00ff 55aa
onsdag 30 september 2020 kl. 07:15:53 UTC+2 skrev Sven Norinder:

> The eeprom probably is a device, not a filesystem.
> Use dd instead.
> /Sven
>
> tisdag 29 september 2020 kl. 17:59:14 UTC+2 skrev Johan Lind:
>
>> I tried with only a short (6 bytes) string but still the same behaviour.
>>
>>
>> tisdag 29 september 2020 kl. 17:45:47 UTC+2 skrev robert.sty...@gmail.com
>> :
>>
>>> I suggest trying to write less than 32 bytes (the dmesg implies 
>>> something wrong with offset or count) -- create a file of less than 32 
>>> bytes and copy to eeprom
>>> cd ~
>>> echo "1234567890" > file10
>>> cp -T file10 /sys/bus/w1/devices/23-02eddd9b/eeprom
>>>
>>> In the data sheet you need a much smaller R[PU] to write than read
>>> https://datasheets.maximintegrated.com/en/ds/DS2433.pdf
>>>
>>> On Tuesday, 29 September 2020 at 16:03:48 UTC+1 RobertCNelson wrote:
>>>
 On Tue, Sep 29, 2020 at 9:55 AM 'Johan Lind' via BeagleBoard 
  wrote: 
 > 
 > Yes, it does still show eeprom 
 > 
 > debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b 
 > driver eeprom id name power subsystem uevent 
 > debian@beaglebone:~$ ls /sys/bus/w1/devices/ 
 > 23-02eddd9b w1_bus_master1 
 > debian@beaglebone:~$ 
 > debian@beaglebone:~$ ls -al /sys/bus/w1/devices/23-02eddd9b/ 
 > total 0 
 > drwxrwxr-x 3 root gpio 0 Sep 29 14:00 . 
 > drwxrwxr-x 4 root gpio 0 Sep 29 14:00 .. 
 > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 driver -> 
 ../../../bus/w1/drivers/w1_slave_driver 
 > -rw-rw-r-- 1 root gpio 512 Sep 29 14:07 eeprom 

 Side note, you don't' have to be root, the "gpio" group is the default 
 for debian.. 

 > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 id 
 > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 name 
 > drwxrwxr-x 2 root gpio 0 Sep 29 14:00 power 
 > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 subsystem -> ../../../bus/w1 
 > -rw-rw-r-- 1 root gpio 4096 Sep 29 14:00 uevent 
 > debian@beaglebone:~$ 

 not sure why you can't write... 

 Regards, 

 -- 
 Robert Nelson 
 https://rcn-ee.com/ 

>>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/3b1beb76-64e6-4a79-964c-035429b5d81cn%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread Sven Norinder
The eeprom probably is a device, not a filesystem.
Use dd instead.
/Sven

tisdag 29 september 2020 kl. 17:59:14 UTC+2 skrev Johan Lind:

> I tried with only a short (6 bytes) string but still the same behaviour.
>
>
> tisdag 29 september 2020 kl. 17:45:47 UTC+2 skrev robert.sty...@gmail.com:
>
>> I suggest trying to write less than 32 bytes (the dmesg implies something 
>> wrong with offset or count) -- create a file of less than 32 bytes and copy 
>> to eeprom
>> cd ~
>> echo "1234567890" > file10
>> cp -T file10 /sys/bus/w1/devices/23-02eddd9b/eeprom
>>
>> In the data sheet you need a much smaller R[PU] to write than read
>> https://datasheets.maximintegrated.com/en/ds/DS2433.pdf
>>
>> On Tuesday, 29 September 2020 at 16:03:48 UTC+1 RobertCNelson wrote:
>>
>>> On Tue, Sep 29, 2020 at 9:55 AM 'Johan Lind' via BeagleBoard 
>>>  wrote: 
>>> > 
>>> > Yes, it does still show eeprom 
>>> > 
>>> > debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b 
>>> > driver eeprom id name power subsystem uevent 
>>> > debian@beaglebone:~$ ls /sys/bus/w1/devices/ 
>>> > 23-02eddd9b w1_bus_master1 
>>> > debian@beaglebone:~$ 
>>> > debian@beaglebone:~$ ls -al /sys/bus/w1/devices/23-02eddd9b/ 
>>> > total 0 
>>> > drwxrwxr-x 3 root gpio 0 Sep 29 14:00 . 
>>> > drwxrwxr-x 4 root gpio 0 Sep 29 14:00 .. 
>>> > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 driver -> 
>>> ../../../bus/w1/drivers/w1_slave_driver 
>>> > -rw-rw-r-- 1 root gpio 512 Sep 29 14:07 eeprom 
>>>
>>> Side note, you don't' have to be root, the "gpio" group is the default 
>>> for debian.. 
>>>
>>> > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 id 
>>> > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 name 
>>> > drwxrwxr-x 2 root gpio 0 Sep 29 14:00 power 
>>> > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 subsystem -> ../../../bus/w1 
>>> > -rw-rw-r-- 1 root gpio 4096 Sep 29 14:00 uevent 
>>> > debian@beaglebone:~$ 
>>>
>>> not sure why you can't write... 
>>>
>>> Regards, 
>>>
>>> -- 
>>> Robert Nelson 
>>> https://rcn-ee.com/ 
>>>
>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/69f994ba-cbbd-4680-840a-a353be874be9n%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread 'Johan Lind' via BeagleBoard
I tried with only a short (6 bytes) string but still the same behaviour.


tisdag 29 september 2020 kl. 17:45:47 UTC+2 skrev robert.sty...@gmail.com:

> I suggest trying to write less than 32 bytes (the dmesg implies something 
> wrong with offset or count) -- create a file of less than 32 bytes and copy 
> to eeprom
> cd ~
> echo "1234567890" > file10
> cp -T file10 /sys/bus/w1/devices/23-02eddd9b/eeprom
>
> In the data sheet you need a much smaller R[PU] to write than read
> https://datasheets.maximintegrated.com/en/ds/DS2433.pdf
>
> On Tuesday, 29 September 2020 at 16:03:48 UTC+1 RobertCNelson wrote:
>
>> On Tue, Sep 29, 2020 at 9:55 AM 'Johan Lind' via BeagleBoard
>>  wrote:
>> >
>> > Yes, it does still show eeprom
>> >
>> > debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b
>> > driver eeprom id name power subsystem uevent
>> > debian@beaglebone:~$ ls /sys/bus/w1/devices/
>> > 23-02eddd9b w1_bus_master1
>> > debian@beaglebone:~$
>> > debian@beaglebone:~$ ls -al /sys/bus/w1/devices/23-02eddd9b/
>> > total 0
>> > drwxrwxr-x 3 root gpio 0 Sep 29 14:00 .
>> > drwxrwxr-x 4 root gpio 0 Sep 29 14:00 ..
>> > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 driver -> 
>> ../../../bus/w1/drivers/w1_slave_driver
>> > -rw-rw-r-- 1 root gpio 512 Sep 29 14:07 eeprom
>>
>> Side note, you don't' have to be root, the "gpio" group is the default
>> for debian..
>>
>> > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 id
>> > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 name
>> > drwxrwxr-x 2 root gpio 0 Sep 29 14:00 power
>> > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 subsystem -> ../../../bus/w1
>> > -rw-rw-r-- 1 root gpio 4096 Sep 29 14:00 uevent
>> > debian@beaglebone:~$
>>
>> not sure why you can't write...
>>
>> Regards,
>>
>> -- 
>> Robert Nelson
>> https://rcn-ee.com/
>>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/a77badb0-94ac-4572-ad58-6616b13ebfa2n%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread robert.sty...@gmail.com
I suggest trying to write less than 32 bytes (the dmesg implies something 
wrong with offset or count) -- create a file of less than 32 bytes and copy 
to eeprom
cd ~
echo "1234567890" > file10
cp -T file10 /sys/bus/w1/devices/23-02eddd9b/eeprom

In the data sheet you need a much smaller R[PU] to write than read
https://datasheets.maximintegrated.com/en/ds/DS2433.pdf

On Tuesday, 29 September 2020 at 16:03:48 UTC+1 RobertCNelson wrote:

> On Tue, Sep 29, 2020 at 9:55 AM 'Johan Lind' via BeagleBoard
>  wrote:
> >
> > Yes, it does still show eeprom
> >
> > debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b
> > driver eeprom id name power subsystem uevent
> > debian@beaglebone:~$ ls /sys/bus/w1/devices/
> > 23-02eddd9b w1_bus_master1
> > debian@beaglebone:~$
> > debian@beaglebone:~$ ls -al /sys/bus/w1/devices/23-02eddd9b/
> > total 0
> > drwxrwxr-x 3 root gpio 0 Sep 29 14:00 .
> > drwxrwxr-x 4 root gpio 0 Sep 29 14:00 ..
> > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 driver -> 
> ../../../bus/w1/drivers/w1_slave_driver
> > -rw-rw-r-- 1 root gpio 512 Sep 29 14:07 eeprom
>
> Side note, you don't' have to be root, the "gpio" group is the default
> for debian..
>
> > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 id
> > -r--r--r-- 1 root gpio 4096 Sep 29 14:00 name
> > drwxrwxr-x 2 root gpio 0 Sep 29 14:00 power
> > lrwxrwxrwx 1 root gpio 0 Sep 29 14:00 subsystem -> ../../../bus/w1
> > -rw-rw-r-- 1 root gpio 4096 Sep 29 14:00 uevent
> > debian@beaglebone:~$
>
> not sure why you can't write...
>
> Regards,
>
> -- 
> Robert Nelson
> https://rcn-ee.com/
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/4ddb5659-5513-4ed6-a282-6ed727b9173an%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread Robert Nelson
On Tue, Sep 29, 2020 at 9:55 AM 'Johan Lind' via BeagleBoard
 wrote:
>
> Yes, it does still show eeprom
>
> debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b
> driver  eeprom  id  name  power  subsystem  uevent
> debian@beaglebone:~$ ls /sys/bus/w1/devices/
> 23-02eddd9b  w1_bus_master1
> debian@beaglebone:~$
> debian@beaglebone:~$ ls -al /sys/bus/w1/devices/23-02eddd9b/
> total 0
> drwxrwxr-x 3 root gpio0 Sep 29 14:00 .
> drwxrwxr-x 4 root gpio0 Sep 29 14:00 ..
> lrwxrwxrwx 1 root gpio0 Sep 29 14:00 driver -> 
> ../../../bus/w1/drivers/w1_slave_driver
> -rw-rw-r-- 1 root gpio  512 Sep 29 14:07 eeprom

Side note, you don't' have to be root, the "gpio" group is the default
for debian..

> -r--r--r-- 1 root gpio 4096 Sep 29 14:00 id
> -r--r--r-- 1 root gpio 4096 Sep 29 14:00 name
> drwxrwxr-x 2 root gpio0 Sep 29 14:00 power
> lrwxrwxrwx 1 root gpio0 Sep 29 14:00 subsystem -> ../../../bus/w1
> -rw-rw-r-- 1 root gpio 4096 Sep 29 14:00 uevent
> debian@beaglebone:~$

not sure why you can't write...

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYj56agF1xQE64O%2BLzA9LXRq_ocecA7ekd4dYR9pJBOnVQ%40mail.gmail.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread 'Johan Lind' via BeagleBoard
Yes, it does still show eeprom

debian@beaglebone:~$ ls /sys/bus/w1/devices/23-02eddd9b
driver  eeprom  id  name  power  subsystem  uevent
debian@beaglebone:~$ ls /sys/bus/w1/devices/
23-02eddd9b  w1_bus_master1
debian@beaglebone:~$
debian@beaglebone:~$ ls -al /sys/bus/w1/devices/23-02eddd9b/
total 0
drwxrwxr-x 3 root gpio0 Sep 29 14:00 .
drwxrwxr-x 4 root gpio0 Sep 29 14:00 ..
lrwxrwxrwx 1 root gpio0 Sep 29 14:00 driver -> 
../../../bus/w1/drivers/w1_slave_driver
-rw-rw-r-- 1 root gpio  512 Sep 29 14:07 eeprom
-r--r--r-- 1 root gpio 4096 Sep 29 14:00 id
-r--r--r-- 1 root gpio 4096 Sep 29 14:00 name
drwxrwxr-x 2 root gpio0 Sep 29 14:00 power
lrwxrwxrwx 1 root gpio0 Sep 29 14:00 subsystem -> ../../../bus/w1
-rw-rw-r-- 1 root gpio 4096 Sep 29 14:00 uevent
debian@beaglebone:~$

tisdag 29 september 2020 kl. 16:36:57 UTC+2 skrev robert.sty...@gmail.com:

> Does 
> ls /sys/bus/w1/devices/23-02eddd9b
> still show eeprom ?
>
> If not, what does
> ls /sys/bus/w1/devices
> show you?
>
> I prefer to run commands from my home director, you can change to your 
> home with 'cd ~'
>
> On Tuesday, 29 September 2020 at 15:15:27 UTC+1 Johan Lind wrote:
>
>> Thank you (and sorry for the double post) !
>> However, I still have no luck writing to the eeprom.
>>
>> I have tried a couple of variations of the commands but I get error even 
>> if logged in as root.
>>
>> debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo sh -c "echo 
>> 'cat /home/debian/file' > eeprom"
>> sh: 1: echo: echo: I/O error
>> debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ su
>> Password:
>> root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# echo 'cat 
>> /home/debian/file' > eeprom
>> bash: echo: write error: Invalid argument
>> root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# cat 
>> /home/debian/file > eeprom
>> cat: write error: Invalid argument
>> root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# exit
>> exit
>> debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cp -T 
>> /home/debian/file eeprom
>> cp: error writing 'eeprom': Invalid argument
>>
>> fredag 25 september 2020 kl. 17:52:55 UTC+2 skrev robert.sty...@gmail.com
>> :
>>
>>> Also the copy command
>>> cp -T *source* *destination*
>>> so...
>>> sudo cp -T /home/debian/file eeprom
>>>
>>> On Friday, 25 September 2020 at 16:48:24 UTC+1 robert.sty...@gmail.com 
>>> wrote:
>>>
 Wasn't the problem that the redirection of output by ">" was outside 
 the sudo *command* 
 The "echo" is not needed, only 
 sudo sh -c "cat /home/debian/file > eeprom"

 On Friday, 25 September 2020 at 15:59:06 UTC+1 RobertCNelson wrote:

> On Fri, Sep 25, 2020 at 9:48 AM johan.lind via BeagleBoard 
>  wrote: 
> > 
> > I would need some help to understand why I can't write to an DS2433 
> eeprom. 
> > 
> > System information: 
> > BBB Industrial board 
> > Debian 10 (Buster IoT Image 2020-04-06) 
> > Hardware attached are DS2482 i2c to w1 interface and DS2433 eeprom. 
> > 
> > Commands executed to set-up system: 
> > $ modprobe ds2482 
> > $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device 
> > $ modprobe wire 
> > 
> > I can read the eeprom by executing 
> > $ cd /sys/bus/w1/devices/23-02eddd9b 
> > $ cat eeprom | hexdump 
> > 
> > Getting this far I assume hardware is correct and drivers are loaded 
> correctly. 
> > 
> > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ ls 
> > driver eeprom id name power subsystem uevent 
> > 
> > Should here be a directory called w1_slave? 
> > I see such a directory on some web pages searching for similar 
> problems with w1. 
> > 
> > Now to the problem. 
> > Executing the following command will fail: 
> > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cat 
> /home/debian/file > eeprom 
> > [sudo] password for debian: 
> > cat: write error: Invalid argument 
>
> https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Privileged_echo 
>
> sudo sh -c "echo 'cat /home/debian/file' > eeprom" 
>
> Regards, 
>
> -- 
> Robert Nelson 
> https://rcn-ee.com/ 
>


-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/43b0b54e-f3c1-4468-94b0-4cf139266cf1n%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread robert.sty...@gmail.com
Does 
ls /sys/bus/w1/devices/23-02eddd9b
still show eeprom ?

If not, what does
ls /sys/bus/w1/devices
show you?

I prefer to run commands from my home director, you can change to your home 
with 'cd ~'

On Tuesday, 29 September 2020 at 15:15:27 UTC+1 Johan Lind wrote:

> Thank you (and sorry for the double post) !
> However, I still have no luck writing to the eeprom.
>
> I have tried a couple of variations of the commands but I get error even 
> if logged in as root.
>
> debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo sh -c "echo 
> 'cat /home/debian/file' > eeprom"
> sh: 1: echo: echo: I/O error
> debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ su
> Password:
> root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# echo 'cat 
> /home/debian/file' > eeprom
> bash: echo: write error: Invalid argument
> root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# cat /home/debian/file 
> > eeprom
> cat: write error: Invalid argument
> root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# exit
> exit
> debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cp -T 
> /home/debian/file eeprom
> cp: error writing 'eeprom': Invalid argument
>
> fredag 25 september 2020 kl. 17:52:55 UTC+2 skrev robert.sty...@gmail.com:
>
>> Also the copy command
>> cp -T *source* *destination*
>> so...
>> sudo cp -T /home/debian/file eeprom
>>
>> On Friday, 25 September 2020 at 16:48:24 UTC+1 robert.sty...@gmail.com 
>> wrote:
>>
>>> Wasn't the problem that the redirection of output by ">" was outside the 
>>> sudo *command* 
>>> The "echo" is not needed, only 
>>> sudo sh -c "cat /home/debian/file > eeprom"
>>>
>>> On Friday, 25 September 2020 at 15:59:06 UTC+1 RobertCNelson wrote:
>>>
 On Fri, Sep 25, 2020 at 9:48 AM johan.lind via BeagleBoard 
  wrote: 
 > 
 > I would need some help to understand why I can't write to an DS2433 
 eeprom. 
 > 
 > System information: 
 > BBB Industrial board 
 > Debian 10 (Buster IoT Image 2020-04-06) 
 > Hardware attached are DS2482 i2c to w1 interface and DS2433 eeprom. 
 > 
 > Commands executed to set-up system: 
 > $ modprobe ds2482 
 > $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device 
 > $ modprobe wire 
 > 
 > I can read the eeprom by executing 
 > $ cd /sys/bus/w1/devices/23-02eddd9b 
 > $ cat eeprom | hexdump 
 > 
 > Getting this far I assume hardware is correct and drivers are loaded 
 correctly. 
 > 
 > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ ls 
 > driver eeprom id name power subsystem uevent 
 > 
 > Should here be a directory called w1_slave? 
 > I see such a directory on some web pages searching for similar 
 problems with w1. 
 > 
 > Now to the problem. 
 > Executing the following command will fail: 
 > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cat 
 /home/debian/file > eeprom 
 > [sudo] password for debian: 
 > cat: write error: Invalid argument 

 https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Privileged_echo 

 sudo sh -c "echo 'cat /home/debian/file' > eeprom" 

 Regards, 

 -- 
 Robert Nelson 
 https://rcn-ee.com/ 

>>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/b1989070-3ca8-46a1-951c-c39daeaa8644n%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-29 Thread 'Johan Lind' via BeagleBoard
Thank you (and sorry for the double post) !
However, I still have no luck writing to the eeprom.

I have tried a couple of variations of the commands but I get error even if 
logged in as root.

debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo sh -c "echo 
'cat /home/debian/file' > eeprom"
sh: 1: echo: echo: I/O error
debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ su
Password:
root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# echo 'cat 
/home/debian/file' > eeprom
bash: echo: write error: Invalid argument
root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# cat /home/debian/file 
> eeprom
cat: write error: Invalid argument
root@beaglebone:/sys/bus/w1/devices/23-02eddd9b# exit
exit
debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cp -T 
/home/debian/file eeprom
cp: error writing 'eeprom': Invalid argument

fredag 25 september 2020 kl. 17:52:55 UTC+2 skrev robert.sty...@gmail.com:

> Also the copy command
> cp -T *source* *destination*
> so...
> sudo cp -T /home/debian/file eeprom
>
> On Friday, 25 September 2020 at 16:48:24 UTC+1 robert.sty...@gmail.com 
> wrote:
>
>> Wasn't the problem that the redirection of output by ">" was outside the 
>> sudo *command* 
>> The "echo" is not needed, only 
>> sudo sh -c "cat /home/debian/file > eeprom"
>>
>> On Friday, 25 September 2020 at 15:59:06 UTC+1 RobertCNelson wrote:
>>
>>> On Fri, Sep 25, 2020 at 9:48 AM johan.lind via BeagleBoard
>>>  wrote:
>>> >
>>> > I would need some help to understand why I can't write to an DS2433 
>>> eeprom.
>>> >
>>> > System information:
>>> > BBB Industrial board
>>> > Debian 10 (Buster IoT Image 2020-04-06)
>>> > Hardware attached are DS2482 i2c to w1 interface and DS2433 eeprom.
>>> >
>>> > Commands executed to set-up system:
>>> > $ modprobe ds2482
>>> > $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device
>>> > $ modprobe wire
>>> >
>>> > I can read the eeprom by executing
>>> > $ cd /sys/bus/w1/devices/23-02eddd9b
>>> > $ cat eeprom | hexdump
>>> >
>>> > Getting this far I assume hardware is correct and drivers are loaded 
>>> correctly.
>>> >
>>> > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ ls
>>> > driver eeprom id name power subsystem uevent
>>> >
>>> > Should here be a directory called w1_slave?
>>> > I see such a directory on some web pages searching for similar 
>>> problems with w1.
>>> >
>>> > Now to the problem.
>>> > Executing the following command will fail:
>>> > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cat 
>>> /home/debian/file > eeprom
>>> > [sudo] password for debian:
>>> > cat: write error: Invalid argument
>>>
>>> https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Privileged_echo
>>>
>>> sudo sh -c "echo 'cat /home/debian/file' > eeprom"
>>>
>>> Regards,
>>>
>>> -- 
>>> Robert Nelson
>>> https://rcn-ee.com/
>>>
>>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/6a4bf2f0-522c-4e18-8846-7dcc0ab989b4n%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-25 Thread robert.sty...@gmail.com
Also the copy command
cp -T *source* *destination*
so...
sudo cp -T /home/debian/file eeprom

On Friday, 25 September 2020 at 16:48:24 UTC+1 robert.sty...@gmail.com 
wrote:

> Wasn't the problem that the redirection of output by ">" was outside the 
> sudo *command* 
> The "echo" is not needed, only 
> sudo sh -c "cat /home/debian/file > eeprom"
>
> On Friday, 25 September 2020 at 15:59:06 UTC+1 RobertCNelson wrote:
>
>> On Fri, Sep 25, 2020 at 9:48 AM johan.lind via BeagleBoard
>>  wrote:
>> >
>> > I would need some help to understand why I can't write to an DS2433 
>> eeprom.
>> >
>> > System information:
>> > BBB Industrial board
>> > Debian 10 (Buster IoT Image 2020-04-06)
>> > Hardware attached are DS2482 i2c to w1 interface and DS2433 eeprom.
>> >
>> > Commands executed to set-up system:
>> > $ modprobe ds2482
>> > $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device
>> > $ modprobe wire
>> >
>> > I can read the eeprom by executing
>> > $ cd /sys/bus/w1/devices/23-02eddd9b
>> > $ cat eeprom | hexdump
>> >
>> > Getting this far I assume hardware is correct and drivers are loaded 
>> correctly.
>> >
>> > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ ls
>> > driver eeprom id name power subsystem uevent
>> >
>> > Should here be a directory called w1_slave?
>> > I see such a directory on some web pages searching for similar problems 
>> with w1.
>> >
>> > Now to the problem.
>> > Executing the following command will fail:
>> > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cat 
>> /home/debian/file > eeprom
>> > [sudo] password for debian:
>> > cat: write error: Invalid argument
>>
>> https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Privileged_echo
>>
>> sudo sh -c "echo 'cat /home/debian/file' > eeprom"
>>
>> Regards,
>>
>> -- 
>> Robert Nelson
>> https://rcn-ee.com/
>>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/c5168228-f819-408a-ab7f-2bcd05d4dfccn%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-25 Thread robert.sty...@gmail.com
Wasn't the problem that the redirection of output by ">" was outside the 
sudo *command* 
The "echo" is not needed, only 
sudo sh -c "cat /home/debian/file > eeprom"

On Friday, 25 September 2020 at 15:59:06 UTC+1 RobertCNelson wrote:

> On Fri, Sep 25, 2020 at 9:48 AM johan.lind via BeagleBoard
>  wrote:
> >
> > I would need some help to understand why I can't write to an DS2433 
> eeprom.
> >
> > System information:
> > BBB Industrial board
> > Debian 10 (Buster IoT Image 2020-04-06)
> > Hardware attached are DS2482 i2c to w1 interface and DS2433 eeprom.
> >
> > Commands executed to set-up system:
> > $ modprobe ds2482
> > $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device
> > $ modprobe wire
> >
> > I can read the eeprom by executing
> > $ cd /sys/bus/w1/devices/23-02eddd9b
> > $ cat eeprom | hexdump
> >
> > Getting this far I assume hardware is correct and drivers are loaded 
> correctly.
> >
> > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ ls
> > driver eeprom id name power subsystem uevent
> >
> > Should here be a directory called w1_slave?
> > I see such a directory on some web pages searching for similar problems 
> with w1.
> >
> > Now to the problem.
> > Executing the following command will fail:
> > debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cat 
> /home/debian/file > eeprom
> > [sudo] password for debian:
> > cat: write error: Invalid argument
>
> https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Privileged_echo
>
> sudo sh -c "echo 'cat /home/debian/file' > eeprom"
>
> Regards,
>
> -- 
> Robert Nelson
> https://rcn-ee.com/
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/3065c659-6385-4fb8-94d2-1ac2c853675fn%40googlegroups.com.


Re: [beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-25 Thread Robert Nelson
On Fri, Sep 25, 2020 at 9:48 AM johan.lind via BeagleBoard
 wrote:
>
> I would need some help to understand why I can't write to an DS2433 eeprom.
>
> System information:
> BBB Industrial board
> Debian 10 (Buster IoT Image 2020-04-06)
> Hardware attached are DS2482 i2c to w1 interface and DS2433 eeprom.
>
> Commands executed to set-up system:
> $ modprobe ds2482
> $ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device
> $ modprobe wire
>
> I can read the eeprom by executing
> $ cd /sys/bus/w1/devices/23-02eddd9b
> $ cat eeprom | hexdump
>
> Getting this far I assume hardware is correct and drivers are loaded 
> correctly.
>
> debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ ls
> driver  eeprom  id  name  power  subsystem  uevent
>
> Should here be a directory called w1_slave?
> I see such a directory on some web pages searching for similar problems with 
> w1.
>
> Now to the problem.
> Executing the following command will fail:
> debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cat 
> /home/debian/file > eeprom
> [sudo] password for debian:
> cat: write error: Invalid argument

https://elinux.org/Beagleboard:BeagleBoneBlack_Debian#Privileged_echo

sudo sh -c "echo 'cat /home/debian/file' > eeprom"

Regards,

-- 
Robert Nelson
https://rcn-ee.com/

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/CAOCHtYjESKmr1VJZz62uC-7t9rWzqJjZO114E6kZ5pvi9ZpX%3DQ%40mail.gmail.com.


[beagleboard] writing data to 1-wire DS2433 eeprom fails

2020-09-25 Thread johan.lind via BeagleBoard
I would need some help to understand why I can't write to an DS2433 eeprom.

System information:
BBB Industrial board
Debian 10 (Buster IoT Image 2020-04-06)
Hardware attached are DS2482 i2c to w1 interface and DS2433 eeprom.

Commands executed to set-up system:
$ modprobe ds2482
$ echo ds2482 0x18 > /sys/bus/i2c/devices/i2c-1/new_device
$ modprobe wire

I can read the eeprom by executing
$ cd /sys/bus/w1/devices/23-02eddd9b
$ cat eeprom | hexdump

Getting this far I assume hardware is correct and drivers are loaded 
correctly.

debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ ls
driver  eeprom  id  name  power  subsystem  uevent

Should here be a directory called w1_slave?
I see such a directory on some web pages searching for similar problems 
with w1.

Now to the problem.
Executing the following command will fail:
debian@beaglebone:/sys/bus/w1/devices/23-02eddd9b$ sudo cat 
/home/debian/file > eeprom
[sudo] password for debian:
cat: write error: Invalid argument

To me the error looks like the device doesn't have a write function 
implemented,
however looking at the source it looks like it does.

$ dmesg | grep w1
[2329228.747219] w1_master_driver w1_bus_master1: Attaching one wire slave 
23.02eddd9b crc c8
[2493821.327176] w1_slave_driver 23-02eddd9b: invalid offset/count 
off=0 cnt=140
[2514308.615437] w1_slave_driver 23-02eddd9b: invalid offset/count 
off=0 cnt=140


Is there some kind of write protect that needs to be handled?

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to beagleboard+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beagleboard/f4f3d1dc-d571-4b78-ac25-e46e37a83536o%40googlegroups.com.