{"id":4280,"date":"2020-07-17T08:15:04","date_gmt":"2020-07-17T08:15:04","guid":{"rendered":"https:\/\/www.richardmudhar.com\/blog\/?p=4280"},"modified":"2020-08-02T08:20:44","modified_gmt":"2020-08-02T08:20:44","slug":"raspberry-pi-4-with-touchscreen-and-fldigi","status":"publish","type":"post","link":"https:\/\/www.richardmudhar.com\/blog\/2020\/07\/raspberry-pi-4-with-touchscreen-and-fldigi\/","title":{"rendered":"Raspberry Pi 4 with touchscreen and FLdigi"},"content":{"rendered":"<p>I got a new Raspberry Pi v4 and the official touchscreen. The aim of this is to be able to run FLdigi and WSJT-X<sup id=\"fnref-4280-1\"><a href=\"#fn-4280-1\" class=\"jetpack-footnote\">1<\/a><\/sup> in a portable setup. Also to stop FLdigi getting hopelessly confused on my main PC &#8211; with two sound cards already adding a third sound card as interface for the radio meant portaudio, whatever that is, gets hopelessly confused on Windows and loses touch with the hardware intermittently.<\/p>\n<p>Setting it up was surprisingly painless &#8211; blow a new 16Gb SD card with Raspbian, connect screen to the 5V and 0V on the GPIO and the <a href=\"https:\/\/www.raspberrypi.org\/documentation\/hardware\/display\/\">ribbon cable to DSI<\/a>. Normally you then have to remember to add the <a href=\"https:\/\/www.raspberrypi.org\/documentation\/remote-access\/ssh\/README.md\">empty file ssh<\/a> to the boot partition with the PC so you can talk to the damn thing, and perhaps <a href=\"https:\/\/www.raspberrypi.org\/documentation\/configuration\/wireless\/headless.md\">wrangle the wireless config<\/a> if the Pi doesn&#8217;t have Ethernet.<\/p>\n<p>With the touchscreen I didn&#8217;t need all that. Although I started it up on ethernet, the onboard Bluetooth meant I could connect a Bluetooth keyboard using just the touchscreen, and then set up the wifi in the usual way. The touchscreen needs a reasonably firm press, this is no responsive smartphone screen, and being so small it is sometimes hard to get the right target, even with a conductive stylus, particularly as I set the font size a little smaller to use the screen area more.<!--more--><\/p>\n<p>It came up first time, the keyboard connected easily using just the touchscreen, which prompted entering a six-digit number on the keyboard to pair it.The screen starts upside down in the frame but this <a href=\"https:\/\/support.thepihut.com\/hc\/en-us\/articles\/115002072865-Official-touchscreen-is-upside-down\">is easily fixable<\/a> with<\/p>\n<p>sudo nano \/boot\/config.txt to add the line<\/p>\n<p>lcd_rotate=2<\/p>\n<h3>The Raspberry Pi official touchscreen is low resolution 800&#215;480<\/h3>\n<p>and a lot of software just can&#8217;t believe you are running it on such a small screen, so the software window doesn&#8217;t get small enough to fit on the screen. The bottom and often the right is cut off. I thought this was a showstopper until I <a href=\"https:\/\/raspberryinsider.com\/top-15-raspberry-pi-keyboard-shortcuts\/\">discovered<\/a> the Alt-Space command, which can be followed by M to let you move the window with the touchscreen to see the otherwise inaccessible parts, which usually include the OK and Save Config buttons. It&#8217;s not the most convenient way of using a program, but it gets the job done. At home I can use RDP into the box to get a bigger screen on my PC. The <a href=\"https:\/\/www.raspberrypi.org\/forums\/viewtopic.php?f=108&amp;t=184762\">various tricks to remap the screen size<\/a> in \/boot\/config.txt like<\/p>\n<pre><code># uncomment to force a console size. By default it will be display's size minus\n# overscan.\nframebuffer_width=1024\nframebuffer_height=614<\/code><\/pre>\n<p>don&#8217;t work on the Pi4 with Buster.<\/p>\n<p>The main gotcha is that the raspbian menu bar pushes programs down by the width of the menu bar, which meant I couldn&#8217;t see the operational controls at the bottom of FLdigi. Under settings appearance setting the bar to medium and at the bottom of the screen meant it got out of the way when I was using FLDigi. For WSJT-X you just have to suck it up and move the program window up and to the left using Alt-Space-M<\/p>\n<figure id=\"attachment_4287\" aria-describedby=\"caption-attachment-4287\" style=\"width: 840px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"wp-image-4287 size-large\" title=\"FLdigi 4.1.01 running on the Pi4\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4031ed.jpg?resize=840%2C456&#038;ssl=1\" alt=\"FLdigi 4.1.01 running on the Pi4\" width=\"840\" height=\"456\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4031ed.jpg?resize=1024%2C556&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4031ed.jpg?resize=550%2C299&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4031ed.jpg?resize=768%2C417&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4031ed.jpg?resize=1200%2C652&amp;ssl=1 1200w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4031ed.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption id=\"caption-attachment-4287\" class=\"wp-caption-text\">FLdigi 4.1.01 running on the Pi4<\/figcaption><\/figure>\n<p>I installed the version of FLdigi from the Raspbian repository, but this is quite an old version, 4.1.01, it&#8217;s up to 4.1.13 at the time of writing, so I will probably uninstall this and compile. I needed to install pavucontrol from the repository and reboot the machine for it to actually recognise the USB audio interface, but after that it all worked fine. A USB serial connector for CAT (computer aided tuning) also appeared after rebooting. The USB sockets on the Pi are close together<\/p>\n<figure id=\"attachment_4288\" aria-describedby=\"caption-attachment-4288\" style=\"width: 840px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-4288\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4027.jpg?resize=840%2C630&#038;ssl=1\" alt=\"Raspberry Pi 4 USB sockets are close together\" width=\"840\" height=\"630\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4027.jpg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4027.jpg?resize=550%2C413&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4027.jpg?resize=768%2C576&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4027.jpg?resize=1200%2C900&amp;ssl=1 1200w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4027.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption id=\"caption-attachment-4288\" class=\"wp-caption-text\">Raspberry Pi 4 USB sockets are close together<\/figcaption><\/figure>\n<p>which means you don&#8217;t get to use all of them if the USB plug has a dongle<\/p>\n<figure id=\"attachment_4290\" aria-describedby=\"caption-attachment-4290\" style=\"width: 1016px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4290\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4033ed.jpg?resize=840%2C577&#038;ssl=1\" alt=\"Pi 4 USB sockets are close together\" width=\"840\" height=\"577\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4033ed.jpg?w=1016&amp;ssl=1 1016w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4033ed.jpg?resize=550%2C378&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4033ed.jpg?resize=768%2C528&amp;ssl=1 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption id=\"caption-attachment-4290\" class=\"wp-caption-text\">Pi 4 USB sockets are close together<\/figcaption><\/figure>\n<p>or is thicker than normal.<\/p>\n<p>With just a touch screen and keyboard you have no way of doing a right mouse click. So far that hasn&#8217;t caused me grief.<\/p>\n<h3>The Raspberry Pi4 is power hungry<\/h3>\n<p>It has a USB-C power socket. There&#8217;s a hoo-hah that the USB-C power socket <a href=\"https:\/\/arstechnica.com\/gadgets\/2019\/07\/raspberry-pi-4-uses-incorrect-usb-c-design-wont-work-with-some-chargers\/\">doesn&#8217;t actually meet the USB-C spec<\/a> in the original incarnation. Pi seem surprisingly cavalier about this, though you only experience the problem if using fancy high-speed data cables with active innards.It&#8217;s a shame Pi did this to save one 5.1k resistor though after this <a href=\"https:\/\/medium.com\/@leung.benson\/how-to-design-a-proper-usb-c-power-sink-hint-not-the-way-raspberry-pi-4-did-it-f470d7a5910\">scathing article on get yer act together<\/a> they seem to at least be changing it on future revisions.\u00a0 I bought the official <a href=\"https:\/\/www.raspberrypi.org\/products\/type-c-power-supply\/\">Raspberry Pi 15W PSU<\/a> for testing, but need a way to run this from a battery in the field. It&#8217;s a shame everything seems to have standardised on 5V for powering, it suits no battery chemistry I know of. I can try with a 5V power bank, ideally I would run the Pi off the 12V radio battery or a car battery. From my days in studio engineering I realised that the fewer batteries you have in the field the more likely things are to work, it is easier to maintain one battery than makes sure all the smaller batteries in gizmos like microphones and radio packs are good to go. On that principle using a Bluetooth keyboard is asking for trouble, yet more batteries to look after. A small USB keyboard with mouse pad would be ideal, but you get mini <em>with<\/em> mouse pad <em>wireless<\/em> or mini <em>without<\/em> mouse pad <em>wired<\/em>.<\/p>\n<h3>A battery powered Pi<\/h3>\n<p>However, using a 5V power bank is probably OK in this case, as it also saves me from ground lift on the 12V supply if the radio (or the Pi) are drawing a lot of power. Unlike ground loops in mains powered equipment, which at leats warn you of the problem with obvious hum, ground lift in DC systems is much more subtle. It gives you odd effects and low frequency noises as power drain changes, until it gets so bad it overheats PCB tracks in some hapless piece of gear that doesn&#8217;t expect to be carry DC current as well as signal ground \ud83d\ude41<\/p>\n<p>My power bank is about five years old, and only rated at DC 2A\/1.5A max[^3]. Don&#8217;tcha love specs like that, presumably the 1.5A is if both sockets are used. It&#8217;s 4.5A if you believe the <a href=\"https:\/\/amzn.to\/2OzzKwk\">magical thinking and iSmart in the ad for it<\/a>. Since RPi couldn&#8217;t get the USB-C spec right in the first place they probably don&#8217;t have the fanciness to <a href=\"https:\/\/blog.ravpower.com\/2019\/03\/ismart-charging-everything-you-need-to-know\/\">conspire with iSmart<\/a> and get the 4.5A variant, so the lo-tech way of paralleling up sockets is more likely to work.<\/p>\n<p>I connected the Pi to this with a no-name USB-A to USB-C cable. While it did grizzle about power, displaying a lightning flash i nthe top right corner of the screen for a few seconds in the booting process it did start and run fine, with the USB sound card and RS232 CAT interface plugged in.<\/p>\n<figure id=\"attachment_4296\" aria-describedby=\"caption-attachment-4296\" style=\"width: 840px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-4296\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4034.jpg?resize=840%2C630&#038;ssl=1\" alt=\"A battery powered Raspberry Pi 4 running FLDigi\" width=\"840\" height=\"630\" srcset=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4034.jpg?resize=1024%2C768&amp;ssl=1 1024w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4034.jpg?resize=550%2C413&amp;ssl=1 550w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4034.jpg?resize=768%2C576&amp;ssl=1 768w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4034.jpg?resize=1200%2C900&amp;ssl=1 1200w, https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4034.jpg?w=1280&amp;ssl=1 1280w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><figcaption id=\"caption-attachment-4296\" class=\"wp-caption-text\">A battery powered Raspberry Pi 4 running FLDigi<\/figcaption><\/figure>\n<p>I would probably be wise to get a short USB-C power cable, and not the cheapest China can supply too. Be nice if it had two USB-A plugs so I could use the 3A power capacity. According to the <a href=\"https:\/\/www.raspberrypi.org\/products\/raspberry-pi-4-model-b\/specifications\/\">Raspberry Pi spec<\/a> I am pushing my luck with the 2A limit, as I should really have a 2.5A supply if running USB peripherals. It worked, a more modern battery bank might be in order. In the meantime,\u00a0 splurging \u00a34 on one of these 2<a href=\"https:\/\/amzn.to\/2Ovm5X1\">x USB-A to USB-C cables <\/a>could help me stay in spec, however. Running 3A through a tiny USB-C connector gives me a bad feeling, it hardly looks like a 3A connector, but presumably they wrote the USB-C spec right \ud83d\ude09<\/p>\n<figure id=\"attachment_4302\" aria-describedby=\"caption-attachment-4302\" style=\"width: 222px\" class=\"wp-caption aligncenter\"><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-4302\" src=\"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/2007_bs546plug.jpg?resize=222%2C200&#038;ssl=1\" alt=\"2A BS546 plug\" width=\"222\" height=\"200\" \/><figcaption id=\"caption-attachment-4302\" class=\"wp-caption-text\">back in the days of BS546, a plug <a href=\"https:\/\/en.wikipedia.org\/wiki\/AC_power_plugs_and_sockets:_British_and_related_types#Characteristics_of_BS_546_three-pin_plugs\">specified 3.6mm diameter pins<\/a> to be able to handle 2A<\/figcaption><\/figure>\n<p>You have to remember to unplug the Pi after powering it down, else the quiescent current of the LED<sup id=\"fnref-4280-2\"><a href=\"#fn-4280-2\" class=\"jetpack-footnote\">2<\/a><\/sup> and the Pi will drain the battery. Which is a bit crummy, when are Raspberry Pi going to finally realise than many field applications would greatly benefit from being able to reduce power to a more respectable level (say &lt; 1mA) when turned &#8230; off?<\/p>\n<p>All in all the Pi4 was a surprisingly easy win and much more painless to set up than normal, due to the touchscreen onboard Bluetooth and WiFi. There again, the combination is pushing the wrong side of \u00a3100, so you&#8217;d expect greater ease of use. It is surprising how much all the bits add up to that you need to make a Raspberry Pi work &#8211; the <a href=\"https:\/\/www.raspberrypi.org\/blog\/new-price-raspberry-pi-4-2gb\/\">board itself may be $35<\/a> which is a remarkable achievement, but that easily doubles if you want to use it in the real world.<\/p>\n<div class=\"footnotes\">\n<hr \/>\n<ol>\n<li id=\"fn-4280-1\">\nWSJT-X is more demanding of processor power, I have had it running on a Pi3 but it was slow to decode, meaning you tend to miss the next 15s timeslot unless you have exceptionally good reaction times. Setting decode to fast rather than deep minimises this delay, but it&#8217;s still too much to be useful on a Pi3 IMO&#160;<a href=\"#fnref-4280-1\">&#8617;<\/a>\n<\/li>\n<li id=\"fn-4280-2\">\nabout 30mA <a href=\"https:\/\/www.pidramble.com\/wiki\/benchmarks\/power-consumption\">according to this<\/a>&#160;<a href=\"#fnref-4280-2\">&#8617;<\/a>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>I got a new Raspberry Pi v4 and the official touchscreen. The aim of this is to be able to run FLdigi and WSJT-X1 in a portable setup. Also to stop FLdigi getting hopelessly confused on my main PC &#8211; with two sound cards already adding a third sound card as interface for the radio &hellip; <a href=\"https:\/\/www.richardmudhar.com\/blog\/2020\/07\/raspberry-pi-4-with-touchscreen-and-fldigi\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Raspberry Pi 4 with touchscreen and FLdigi&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":4286,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[314,10],"tags":[],"class_list":["post-4280","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-amateur-radio","category-raspberry-pi"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.richardmudhar.com\/blog\/wp-content\/uploads\/2020\/07\/DSCN4026.jpg?fit=1280%2C960&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p5aOO7-172","jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/4280","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/comments?post=4280"}],"version-history":[{"count":13,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/4280\/revisions"}],"predecessor-version":[{"id":4318,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/posts\/4280\/revisions\/4318"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/media\/4286"}],"wp:attachment":[{"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/media?parent=4280"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/categories?post=4280"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.richardmudhar.com\/blog\/wp-json\/wp\/v2\/tags?post=4280"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}