DS1307 RTC breakout bord, error writting /etc/conf.d/rtc-i2c

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

DS1307 RTC breakout bord, error writting /etc/conf.d/rtc-i2c

Post by alphanumeric »

I'm following the tutorial on setting up the DS1307. I get as far as the Raspbian Jessie (Systemd) section. I ran sudo nano /etc/conf.d/rtc-i2c, did the edits but get an
"error writing /etc/conf.d/rtc-i2c: No such file or directory" when I do a ctrl X and try to save the file?
https://learn.adafruit.com/adding-a-rea ... t-rtc-time

What am I missing?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by adafruit_support_mike »

It may be a permissions problem. Try using `sudo nano /etc/conf.d/rtc-i2c`

User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by alphanumeric »

I ran "sudo nano /etc/conf.d/rtc-i2c" as per the tutorial. Should I maybe run sudo bash, then that command?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by adafruit_support_mike »

Quick tip for swapping to a root shell: the command `sudo su -` will make the system act like you've logged in as root. When you type `exit`, you'll drop back to the user account.

Let's double-check something first though: what output do you get from:

Code: Select all

ls -l /etc

User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by alphanumeric »

Running ls -l /etc gets me a long list on the screen, with some in blue text. I see a cron.d but no cronf.d
Running sudo su or sudo bash makes no difference. I still get the no such file or directory when I try to save the file.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by adafruit_support_mike »

I need to see the actual output from the command to see what the problem is.

User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by alphanumeric »

Ok, I'll fire it up and remote in, then clip and past it back to this thread. It will be a few hours from now before I have time to do it. Other things on the go right now.

User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by alphanumeric »

I clipped the output and put it in code tags but it won't let me post it. "Your post contains banned spam words". I have no idea what to edit out? I can't see anything marked or identified?

User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by alphanumeric »

I had to edit out an r m t and replace it with >>>

Code: Select all

pi@raspberrypi:~ $ ls -1 /etc
adduser.conf
adjtime
alternatives
apache2
apm
BANNED.d
apt
avahi
bash.bashrc
bash_completion
bash_completion.d
bindresvport.blacklist
binfmt.d
bluetooth
ca-certificates
ca-certificates.conf
calendar
console-setup
cron.d
cron.daily
cron.hourly
cron.monthly
crontab
cron.weekly
dbus-1
debconf.conf
debian_version
default
deluser.conf
dhcp
dhcp3
dhcpcd.conf
dhcpcd.duid
dictionaries-common
dillo
dphys-swapfile
dpkg
drirc
emacs
environment
esound
fake-hwclock.data
fb.modes
fonts
fstab
fuse.conf
gai.conf
gconf
gdb
ghostscript
gnome
groff
group
group-
gshadow
gshadow-
gss
gtk-2.0
gtk-3.0
hdparm.conf
host.conf
hostname
hosts
hosts.allow
hosts.deny
idmapd.conf
ifplugd
init
init.d
initramfs-tools
inputrc
insserv
insserv.conf
insserv.conf.d
iproute2
issue
issue.net
kbd
kernel
ldap
ld.so.cache
ld.so.conf
ld.so.conf.d
ld.so.preload
libaudit.conf
libnl-3
libreoffice
lightdm
lighttpd
locale.alias
locale.gen
localtime
logcheck
login.defs
logrotate.conf
logrotate.d
machine-id
magic
magic.mime
mailcap
mailcap.order
manpath.config
menu-methods
mime.types
mke2fs.conf
modprobe.d
modules
modules-load.d
motd
mtab
nanorc
netconfig
network
networks
newt
nsswitch.conf
ntp.conf
openal
opt
os-release
PackageKit
pam.conf
pam.d
passwd
passwd-
perl
plymouth
polkit-1
ppp
profile
profile.d
protocols
pulse
python
python2.7
python3
python3.4
rc0.d
rc1.d
rc2.d
rc3.d
rc4.d
rc5.d
rc6.d
rc.local
rcS.d
request-key.d
resolvconf
resolv.conf
resolvconf.conf
>>>
rpc
rpi-issue
rsyslog.conf
rsyslog.d
RTIMULib.ini
samba
securetty
security
selinux
services
sgml
shadow
shadow-
shells
skel
ssh
ssl
staff-group-for-usr-local
subgid
subgid-
subuid
subuid-
sudoers
sudoers.d
sysctl.conf
sysctl.d
systemd
terminfo
timezone
timidity
tmpfiles.d
triggerhappy
ucf.conf
udev
udisks2
ufw
usb_modeswitch.conf
usb_modeswitch.d
vdpau_wrapper.cfg
vim
wgetrc
wildmidi
wpa_supplicant
X11
xdg
xml
xpdf
xrdp
pi@raspberrypi:~ $ 
 

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by adafruit_support_mike »

Thank you. The problem is that you don't have a directory named /etc/conf.d

Do this:

Code: Select all

sudo mkdir /etc/conf.d
sudo nano /etc/conf.d/rtc-i2c

User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by alphanumeric »

Ok, that's what I was thinking too. last night I did a

Code: Select all

sudo -i
cd /etc
mkdir conf.d
sudo nano /etc/conf.d/rtc-i2c
And was able to save the file with no error message.

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by adafruit_support_mike »

Good to hear. Happy hacking!

User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by alphanumeric »

Still doesn't work though. My Pi loses time when powered down. Battery is good. sudo hwclock -r doesn't work now either. I can't read or write the time to from the DS1307. It worked initially, I set it to the correct time in the beginning of the tutorial. I forget what the message was at the moment. I believe the "disable the fake hwclock" part at the end is what did this?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by adafruit_support_mike »

Do you have a battery connected to the DS1307? It needs one to keep time while the RasPi is shut down.

User avatar
alphanumeric
 
Posts: 633
Joined: Sun Sep 07, 2014 7:06 pm

Re: DS1307 RTC breakout bord, error writting /etc/conf.d/rtc

Post by alphanumeric »

Yes, as I said above, Battery is good. I checked it with my battery tester. Polarity is correct too, double checked that to make sure it was in the correct way and not upside down.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”