What about Big Dan the Blogging Man?
First, I’ve been called Big Dan the <blank> Man for so long that I’ve begrudgingly grown used to it.
My primary interests are computers, electronics, and photography.
I’ve created this blog to share some of my various projects in some detail so that I don’t bore Facebook friends with all of the details of what I’m building.
Punctuation
If you ask me a question and you don’t include punctuation, don’t expect an answer. Understanding a technical question enough to answer it is difficult as it is. Don’t make it harder!
Google It!
I don’t get a ton of questions so I try to answer those I do. Some times I’m surprised at the questions that I’m asked because I find the answer immediately upon googling it (yeah, I rarely know the answer to questions I’m asked either).
Coming from the pre-internet days, Google is such an amazing tool, I cannot imagine life without it. And it seems very odd to think of never knowing life before it. It used to be when you had a problem, you read the manuals, the couple of books you might have, and ask coworkers. More often than not you had to work the solution out yourself and it would take entirely too much time.
Take advantage of this amazing tool! I very rarely post questions on any forum. Not because I don’t have a ton of them, because I do. But almost every question I can think of, someone has answered on Google, you just have to track it down, and typically that is way faster than waiting for a forum answer.
Hello Big dan – blogging man
best regards from Austria – excuse my bad english – but our language is german.
i have seen with great interest, your homepage – special your articel to “Lazarus and i2c with RPI”.
my interest is, to learn, open close read and write on i2c-Bus with Lazarus under RPI’s GPIO.
Please do you have a minimal sourcecode with Lazarus, that i can speek with i2c.
i have test my rpi with LXTerminal with the command: sudo i2cdetect -y 1 and i can see my i2c-device-Adresse, but now, it would be nice, if i can this in Lazarus.
Can you help please?
Thanks and best regards form styria – Austria
Hans-Peter Traussnigg
Hi Hans-Peter,
If you look at the bottom of my post https://bigdanzblog.wordpress.com/2014/01/21/accessing-real-time-clock-on-raspberry-pi-using-lazarusfree-pascal/ there is the full code for accessing an I2C real-time clock. Hopefully this will help you.
Dan
Hi Dan.
1000 Thanks for answer. But i have questions to your “program testr2c”.
Is this a program, how use the commandline from LXTerminal or so?
I need to have a “visual Lazarus” form, with buttons and Label.caption to see my i2c – commands.
Is this also going with your program? There probably need commands as: i2c start, i2cstop, i2cread and i2cwrite or so…..
Best regards Hans-Peter
Hi Hans-Peter,
If I understand your question, you want to know if I used the gui components of lazarus? No, this was a simple lazarus console program, but it should work from the GUI interface too. The nice thing about how this is implemented is you are using standard library calls (fpopen, etc). Nothing tricky at the application level.
Here is some commentary for the program:
handle := fpopen(devPath,O_RDWR); – This opens the I2C device for read/write. devPath contains ‘/dev/i2c-1’. You may want to verify that is the correct path for you too.
fpIOCtl(handle, I2C_SLAVE, pointer(iDevAddr)); – this indicates the opened file handle is going to be an I2C_SLAVE device and the address is iDevAddr ($68). You can get that with your i2cdetect command.
fpwrite(handle, buf, 1); – fpwrite is how you send data to the I2C device. Here I send just the first byte of .
fpread(handle, buf, 7); – fpread is how you receive data. Here I retrieve 7 bytes.
Dear Dan
I have great interest to find a solution by your proposal in Lazarus.
Still it does not work with connect the I2C interface.
It comes after the first compilation of Note:
Hint: conversion in between odrinals and pointers is not portable!
Then some error messages come.
The most important thing for me and my anderstand:
What is I2C_Slave = 1795; — why 1795 – is this realy the I2C-Device-Adress?
and what is : iDevAddr: cint = $04 – is this also a I2C- Device-Adress ?
What is true??
handle: cint ??? what can i anderstand under “cint” ???
Please re-politely for assistance.
Thank you very very much!
Best regards
Hans-Peter
I2C_SLAVE is a constant that tells ioctl that the file opened is actually a slave I2C device. Here is some useful info http://stackoverflow.com/questions/9974592/i2c-slave-ioctl-purpose.
iDevAddr is going to be the actual I2C address for your device. That is the address you will see in i2cdetect.
CInt is simply a 32 bit integer. It is defined here: http://www.freepascal.org/docs-html/rtl/ctypes/cint.html.
I’m not sure why you would be getting a conversion error. I’d have to see the code and data defs to even take a guess.
Just wanted to thank you for the ky-040 rotary write up you did. It was very helpful.
Thanks
Mike
I like your electronics blog…very useful stuff. cheers!
Thanks! – Dan
Hello Dan.I’m from Turkey.I have a question about “SIM800L”
Is there a any problems occurs about IMEI registeration of “SIM800L GPRS” modul? I have a SIM800L but when I power on my modul I will just use it within country for 2 months.After 2 months it will be closed.
Can I change the IMEI number of modul via FTDI connection. I want to use it my bike alarm project. Thanks.
The IMEI # is permanently assigned to the chip. I’m not aware of any way to change it. It just uniquely identifies the 800L device/phone to the wireless provider.
As I recall, you just need to provide the EMEI when you register a new SIM card.
Once your project is done and the SIM card ‘expires’, the next time you want to use the 800L, you just register a new SIM card (some times you can reuse the old card).
Chapeau bas, messieurs, un génie !
Quels talents !
Merci Dan pour le partage de vos sérieuses expériences …
I’m on a GPS tracking project with 3 functions.
1. Getting GPS cordinates
2. Posting GPS cordinates
3. Turning a relay switch (engine control) on or off and additionally get the GPS coordinates when sms commands are sent.
The first 2 functions work in the loop function but the 3rd doesn’t work. The 3rd function is totally ignored. I feel it’s a buffer overflow. I’m not very experienced with Arduino and I’ll like you to assist me.
If you ask me specific questions and include code examples, I will see what I can do.
Is there a way I can send you my codes? I mean a private channel.
Thanks
Dear Dan
I used you sample code below to test Ds18b20 temperature sensor using Feather adafruit huzzah esp8266 with GPIO pin 12 and corresponding lua pin of 6 .However,I am getting temperature reading of 85 c which is not accurate reading.
hence, could you suggest me any thing ,please?
Yours faithfully,
sami
pin=6
ow.setup(pin)
count = 0
repeat
count = count + 1
addr = ow.reset_search(pin)
addr = ow.search(pin)
tmr.wdclr()
until((addr ~= nil) or (count > 100))
if (addr == nil) then
print(“No more addresses.”)
else
–print(addr:byte(1,8))
s=string.format(“Addr:%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X”,
addr:byte(1),addr:byte(2),addr:byte(3),addr:byte(4),
addr:byte(5),addr:byte(6),addr:byte(7),addr:byte(8))
print(s)
crc = ow.crc8(string.sub(addr,1,7))
if (crc == addr:byte(8)) then
if ((addr:byte(1) == 0x10) or (addr:byte(1) == 0x28)) then
print(“Device is a DS18S20 family device.”)
repeat
ow.reset(pin)
ow.select(pin, addr)
ow.write(pin, 0x44, 1)
tmr.delay(1000000)
present = ow.reset(pin)
ow.select(pin, addr)
ow.write(pin,0xBE,1)
print(“P=”..present)
data = nil
data = string.char(ow.read(pin))
for i = 1, 8 do
data = data .. string.char(ow.read(pin))
end
–print(data:byte(1,9))
s=string.format(“Data:%02X-%02X-%02X-%02X-%02X-%02X-%02X-%02X”,
data:byte(1),data:byte(2),data:byte(3), data:byte(4),
data:byte(5),data:byte(6), data:byte(7),data:byte(8))
print(s)
crc = ow.crc8(string.sub(data,1,8))
–print(“CRC=”..crc)
s=string.format(“CRC: %02X”, crc)
print(s)
if (crc == data:byte(9)) then
t = (data:byte(1) + data:byte(2) * 256) * 625
t1 = t / 10000
t2 = t % 10000
print(“Temperature= “..t1..”.”..t2..” Centigrade”)
end
tmr.wdclr()
until false
else
print(“Device family is not recognized.”)
end
else
print(“CRC is not valid!”)
end
end
Per http://forum.arduino.cc/index.php?topic=201863.0 “There is a footnote on page 4 which says “The power-on reset value of the temperature register is +85°C.”
so if you read 85 degrees it means it hasn’t done a conversion since the last power on.
You hadn’t wired it up properly so the sensor was being powered off and on periodically, which resets the register to 85 and that is why you got a valid CRC from it.”
So 85C indicates there is a problem w/ the sensor. I don’t know what that problem may be off hand, but look at the above thread and look for other guys w/
the same issue and hopefully you can figure it out.
Dear Dan
Thank you for help.
Hi Dan
We really like this blog and want to feature it on our website. If you are interested, kindly drop me a message on my e-mail: nmulaaccess@gmail.com. I’ll be looking forward to your response! Thanks.
What website?
You may check, EETech Media at http://www.eetech.com and its tech community sites. Send me an email so I can provide you more details related to it. Thanks. -Neil
Pingback: Warp: Playing Offline | Renga in Blue
Hello Dan I was wondering for the simH pdp-8 emu page, where would I find and download the rk0.dsk file?
I believe you are to download http://www.pdp8online.com/ftp/images/os8/diag-games-kermit.rk05 then copy that to rk0.dsk.
I have the kermit file but i don’t have the rk0.dsk that is what I’m asking about.
What other hard drive image file do I need other than kermit?
I can’t open the dsk file. I’ve used many dsk opening software but none of them work. Any suggestions?
Hello Dan,
I was very happy to find the HP3000 emulator here as I was looking to run Warp via telnet as I used to do, but that seems to be down at the moment (empire.openmpe.com) or maybe permanently? I used to play Warp on our HP3000 back in the day….
I was wondering whether you would know whether there is an emulator for Mac somewhere, too? I looked but did not see. I can run Windows through Parallels on my Mac and the HP3000 emulator works just fine, but I have students who might like to try this, who don’t have Parallels….
Thanks very much!
Karljürgen
I know very little about Macs. A quick search shows this:
https://retrocomputing.stackexchange.com/questions/2767/is-the-simh-emulator-available-on-macos
Have a look at that for ways to get simh on Mac. My quick review of it, I suspect none of the versions precompiled are recent enough to support the HP3000.
I’m running version 4.0-0-Current which was committed to git May 7 2019.
If you can get a version of 4.0 running, then it is just a matter of moving the files in my zip file to the directory of your implementation and ‘fixing things up’.
Hi Dan,
Thanks so much for the quick response! I deeply appreciate it and I’ll look into this further.
You wouldn’t happen to have a copy of the walkthrough, would you? I never got a copy from the old site (hadn’t got to exasperation yet) and now can’t…. No biggie though!
Best wishes,
K
No, I never used that site.