Project piTelex - News Service (Nachrichtendienst)
-
Topic author - Rank 2
- Beiträge: 61
- Registriert: Do 31. Mär 2022, 08:23
- Wohnort: Jackson, Michigan
- Hauptanschluß: 362436 joeyd
- Kontaktdaten:
Project piTelex - News Service (Nachrichtendienst)
I have the news service enabled,
This was a bit of a challenge.
My question:
How do I change the frequency of checking the news feed? To check either more often or less often.
I do not see anything for frequency in telex.json and not sure which module I would need to change??
Also.....
I would also like to change the ending of the stored NEWS telex messages from ++++ to NNNN (USTTY Standard)
And also eliminate the additional "Line Feeds". When it stores the message it adds 2 extra line feeds before and
after the message this uses a lot of paper. <-Help save a tree! LOL!
This was a bit of a challenge.
My question:
How do I change the frequency of checking the news feed? To check either more often or less often.
I do not see anything for frequency in telex.json and not sure which module I would need to change??
Also.....
I would also like to change the ending of the stored NEWS telex messages from ++++ to NNNN (USTTY Standard)
And also eliminate the additional "Line Feeds". When it stores the message it adds 2 extra line feeds before and
after the message this uses a lot of paper. <-Help save a tree! LOL!
Try to stay mellow like the Dachshund! 
362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
-
- Rank 8
- Beiträge: 723
- Registriert: Fr 26. Jun 2020, 18:53
- Wohnort: Aachen
- Hauptanschluß: 833539 fili d
Re: Project piTelex - News Service (Nachrichtendienst)
https://github.com/fablab-wue/piTelex/w ... FileWriter
says there is a command line parameter for rssFileWriter.py: -t or --timeout : timeout(seconds) between fetching feed updates, default 10 seconds
Edit rssFileWriter.py. Look for the following routine "formatted_write". Here you can modify the look&feel of the output. I've marked some of the relevant lines with an arrow below:JoeyD hat geschrieben: ↑So 11. Sep 2022, 20:22
Also.....
I would also like to change the ending of the stored NEWS telex messages from ++++ to NNNN (USTTY Standard)
And also eliminate the additional "Line Feeds". When it stores the message it adds 2 extra line feeds before and
after the message this uses a lot of paper. <-Help save a tree! LOL!
Code: Alles auswählen
def formatted_write(output_path, rss_entry, visible_name, split_lines):
with open(outfilename, "a+") as outfile:
summary = h.handle(rss_entry.summary)
summary = summary.replace('\n', ' ')
heading = visible_name + " " + time.strftime("%d.%m.%Y %H:%M:%S", time.localtime(calendar.timegm(rss_entry.published_parsed)))
--> outfile.write(heading + "\n\n")
heading = rss_entry.title
heading = split_newline_after("== " + heading + " ==", split_lines)
#summary = " " + summary
summary = split_newline_after(summary, split_lines)
--> outfile.write(heading + "\n")
--> outfile.write(summary + "\n++++\n")
print(heading)
print(summary)
Viele Grüße,
Rolf
Rolf
833533 rolfac d (T100S) 24/7 833538 obrac d (FS220) 24/7 833539 fili d (T100a) 24/7 833540 rowo d (T100/R) 24/7 833541 obby d (T37h) 24/7 833142 rolf d (Lo15A) 24/7 83110 aachen d (T68d) 24/7 (ETSt Aachen)
-
Topic author - Rank 2
- Beiträge: 61
- Registriert: Do 31. Mär 2022, 08:23
- Wohnort: Jackson, Michigan
- Hauptanschluß: 362436 joeyd
- Kontaktdaten:
Re: Project piTelex - News Service (Nachrichtendienst)
Obrac,
Thanks for the reply!
The second part of your reply on new lines is EXACTLY what I needed!
I see all the offending extra new lines that I want to eliminate.
On to the first part.... I probably was not clear.......
I know I can change the time if I call the newsfeed from the command line using ./rssFileWriter.py -t "XX"
I want to change the time calling multiple copies using "./rss-feed" script
A time change this was not offered only "list, status, start, stop, and help"
I think I found the line to change......
python3 $RSSROOT/rssFileWriter.py -f -s "$LINELENGTH" -n "$SVC" -p "$NEWS/$SVC/" -u "$URL" &> "$LOG/$SVC.log"
I think I just need to add the desired -t time out like this???....
python3 $RSSROOT/rssFileWriter.py -f -t 3600 -s "$LINELENGTH" -n "$SVC" -p "$NEWS/$SVC/" -u "$URL" &> "$LOG/$SVC.log"
The rss-feed file script indicates "### no user serviceable parts below ###"
So not sure what sort of mess I invite changing this line? My timing is for 1 hour checks and not sure if it will accept this?
And if it does it is a very long wait to find out! ;-)
Also I find it easier to ask about code I'm not familiar with incase this may break something somewhere else...
Thanks again/Danke!!
JD
Thanks for the reply!
The second part of your reply on new lines is EXACTLY what I needed!
I see all the offending extra new lines that I want to eliminate.
On to the first part.... I probably was not clear.......
I know I can change the time if I call the newsfeed from the command line using ./rssFileWriter.py -t "XX"
I want to change the time calling multiple copies using "./rss-feed" script
A time change this was not offered only "list, status, start, stop, and help"
I think I found the line to change......
python3 $RSSROOT/rssFileWriter.py -f -s "$LINELENGTH" -n "$SVC" -p "$NEWS/$SVC/" -u "$URL" &> "$LOG/$SVC.log"
I think I just need to add the desired -t time out like this???....
python3 $RSSROOT/rssFileWriter.py -f -t 3600 -s "$LINELENGTH" -n "$SVC" -p "$NEWS/$SVC/" -u "$URL" &> "$LOG/$SVC.log"
The rss-feed file script indicates "### no user serviceable parts below ###"
So not sure what sort of mess I invite changing this line? My timing is for 1 hour checks and not sure if it will accept this?
And if it does it is a very long wait to find out! ;-)
Also I find it easier to ask about code I'm not familiar with incase this may break something somewhere else...
Thanks again/Danke!!
JD
Try to stay mellow like the Dachshund! 
362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
-
- Rank 8
- Beiträge: 723
- Registriert: Fr 26. Jun 2020, 18:53
- Wohnort: Aachen
- Hauptanschluß: 833539 fili d
Re: Project piTelex - News Service (Nachrichtendienst)
Exactly.
There should be no side effects. If you encounter one, let me know
I did not use such a long interval up to now, therefore I cannot say wether this might be a problem or not, but I think it should be okay.
Hear from. you after a couple of hours
Viele Grüße,
Rolf
Rolf
833533 rolfac d (T100S) 24/7 833538 obrac d (FS220) 24/7 833539 fili d (T100a) 24/7 833540 rowo d (T100/R) 24/7 833541 obby d (T37h) 24/7 833142 rolf d (Lo15A) 24/7 83110 aachen d (T68d) 24/7 (ETSt Aachen)
-
Topic author - Rank 2
- Beiträge: 61
- Registriert: Do 31. Mär 2022, 08:23
- Wohnort: Jackson, Michigan
- Hauptanschluß: 362436 joeyd
- Kontaktdaten:
Re: Project piTelex - News Service (Nachrichtendienst)
Obrecht,
Ideally I would like to make the configuration file different for each news service.
Some to check on the hour
Some to check on the .1 hour. or whatever I choose like a day
Something like....
Detroit_News 3600 https://rssfeeds.detroitnews.com/detroit/news&m=1
BBC_News 360 http://feeds.bbci.co.uk/news/rss.xml
Welt_News 86400 https://www.welt.de/feeds/latest.rss
But I need to study how the CFG and rss-feed passes the two variables down and change to 3 variables??
I do not need them to check every 10 seconds. But I would like different intervals for different services
I have some I would only like to check once a day (86400) seconds...
I do not know what the timers maximum limit is????
Ideally I would like to make the configuration file different for each news service.
Some to check on the hour
Some to check on the .1 hour. or whatever I choose like a day
Something like....
Detroit_News 3600 https://rssfeeds.detroitnews.com/detroit/news&m=1
BBC_News 360 http://feeds.bbci.co.uk/news/rss.xml
Welt_News 86400 https://www.welt.de/feeds/latest.rss
But I need to study how the CFG and rss-feed passes the two variables down and change to 3 variables??
I do not need them to check every 10 seconds. But I would like different intervals for different services
I have some I would only like to check once a day (86400) seconds...
I do not know what the timers maximum limit is????
Try to stay mellow like the Dachshund! 
362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
-
- Rank 8
- Beiträge: 723
- Registriert: Fr 26. Jun 2020, 18:53
- Wohnort: Aachen
- Hauptanschluß: 833539 fili d
Re: Project piTelex - News Service (Nachrichtendienst)
Joey,
I managed to adapt rss-feed script to your needs (hopefully). Please try the script from branach 'exp-r01f'.
You should be able to specify the timeout as third parameter in each line of the cfg file; if omitted, it defaults to 10 seconds.
The given timeout just calls the python routine time.sleep() which should be the only limitation concerning the duration.
I would be glad to hear from you about your experience with this version!
Viele Grüße,
Rolf
Rolf
833533 rolfac d (T100S) 24/7 833538 obrac d (FS220) 24/7 833539 fili d (T100a) 24/7 833540 rowo d (T100/R) 24/7 833541 obby d (T37h) 24/7 833142 rolf d (Lo15A) 24/7 83110 aachen d (T68d) 24/7 (ETSt Aachen)
-
Topic author - Rank 2
- Beiträge: 61
- Registriert: Do 31. Mär 2022, 08:23
- Wohnort: Jackson, Michigan
- Hauptanschluß: 362436 joeyd
- Kontaktdaten:
Re: Project piTelex - News Service (Nachrichtendienst)
Obrecht,
I'd like to report that your CFG and rss-feed changes work perfectly!!
And my changes to remove the extra "/n" new lines in rssFileWriter.py also work great.
This took some time to test as I had most of the feeds checking every hour 3600seconds vs every 10 seconds.
When it is checking 10 feeds every 10 seconds it chews up bandwidth and processor time for actual telex connections.
==========================
Which brings up one small problem.... When the news is sent to be printed "by the telex" the time out to shut off the motor is
extremely long. It will print the stories then the motor will stay on for a few minutes and eventually shut off. During the time it
is idle from printing and motor running it will not accept a telex call..
Not sure where that setting is.
==========================
Anyway...
Thanks again for the help!!
Now we need to figure out how to get my twitter to work!!! ;-)
JD
I'd like to report that your CFG and rss-feed changes work perfectly!!
And my changes to remove the extra "/n" new lines in rssFileWriter.py also work great.
This took some time to test as I had most of the feeds checking every hour 3600seconds vs every 10 seconds.
When it is checking 10 feeds every 10 seconds it chews up bandwidth and processor time for actual telex connections.
==========================
Which brings up one small problem.... When the news is sent to be printed "by the telex" the time out to shut off the motor is
extremely long. It will print the stories then the motor will stay on for a few minutes and eventually shut off. During the time it
is idle from printing and motor running it will not accept a telex call..
Not sure where that setting is.
==========================
Anyway...
Thanks again for the help!!
Now we need to figure out how to get my twitter to work!!! ;-)
JD
Try to stay mellow like the Dachshund! 
362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7
-
- Rank 8
- Beiträge: 723
- Registriert: Fr 26. Jun 2020, 18:53
- Wohnort: Aachen
- Hauptanschluß: 833539 fili d
Re: Project piTelex - News Service (Nachrichtendienst)
This is controlled by some watchdog timeouts, and I don't know how to change this without interfering with other dependencies. But there's no reason to let the printer wait for nothing when the message has been completely printed. So the following hack works for me, and will possibly also do for you (no warranty for anything...):JoeyD hat geschrieben: ↑Do 15. Sep 2022, 06:37 Which brings up one small problem.... When the news is sent to be printed "by the telex" the time out to shut off the motor is
extremely long. It will print the stories then the motor will stay on for a few minutes and eventually shut off. During the time it
is idle from printing and motor running it will not accept a telex call..
Not sure where that setting is.

Edit txDevNews.py, look for the following lines of code at the bottom of the file:
Code: Alles auswählen
def idle20Hz(self):
(... some more lines....)
for a in aa:
self._rx_buffer.append(a)
Code: Alles auswählen
self._rx_buffer.append('\x1bST')
Code: Alles auswählen
def idle20Hz(self):
(... some more lines....)
for a in aa:
self._rx_buffer.append(a)
self._rx_buffer.append('\x1bST')
Adding the "ST" command tells piTelex that the "ST" button has been pressed on the FSG, so that it goes back into standby
Errr...not my job.... but Jochen (JKde) can certainly help. BTW: Did you try the new Twitter version twitterv2? The developer seems to be very active and will answer your questions, I think. Up to now, it is only part of the master branch (only Jochen knows why...)
Good look, and nice to hear from you in the future, maybe as a telex msg?
Viele Grüße,
Rolf
Rolf
833533 rolfac d (T100S) 24/7 833538 obrac d (FS220) 24/7 833539 fili d (T100a) 24/7 833540 rowo d (T100/R) 24/7 833541 obby d (T37h) 24/7 833142 rolf d (Lo15A) 24/7 83110 aachen d (T68d) 24/7 (ETSt Aachen)
-
Topic author - Rank 2
- Beiträge: 61
- Registriert: Do 31. Mär 2022, 08:23
- Wohnort: Jackson, Michigan
- Hauptanschluß: 362436 joeyd
- Kontaktdaten:
Re: Project piTelex - News Service (Nachrichtendienst)
Obrecht,
I am at work now so I will try the txDevNews.py modification when I get home.
I assume I will need to exit telex.py and restart it.
I don't want to try it remotely in case something messes up and I can't shut the machine off
or it decides to run out of paper!! LOL!!
When I am at home working in the room where all my teletype machines are at
If I happen to hear the motor running, I SSH to the machine and send (ESC)ST effectively ending the idle motor.
So I feel pretty good your work around should fix it!!. Its exactly what I'm doing SSH'ing to it.
Curious this has not annoyed anyone else!, That its not
a commit to the main code??
Thanks again
JD
I am at work now so I will try the txDevNews.py modification when I get home.
I assume I will need to exit telex.py and restart it.
I don't want to try it remotely in case something messes up and I can't shut the machine off
or it decides to run out of paper!! LOL!!
When I am at home working in the room where all my teletype machines are at
If I happen to hear the motor running, I SSH to the machine and send (ESC)ST effectively ending the idle motor.
So I feel pretty good your work around should fix it!!. Its exactly what I'm doing SSH'ing to it.
Curious this has not annoyed anyone else!, That its not
a commit to the main code??
Thanks again
JD
Try to stay mellow like the Dachshund! 
362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7

362436: Teletype Model 26 Blatt 24/7
8675309: Western Union 2B Streifen 24/7
2210762: Soviet ST-35 Streifen 24/7
227895: Western Union 28ASR Blatt 24/7
227896: I-Telex Serial + WinTelex24/7