<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Mediacentre Archives - VPN Expert</title>
	<atom:link href="https://vpn-expert.info/tag/mediacentre/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>Life is too short to remove USB safely …</description>
	<lastBuildDate>Thu, 20 Jan 2022 16:17:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.2.2</generator>
	<item>
		<title>curl: send messages from the Raspberry Pi (Linux) to Kodi</title>
		<link>https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/</link>
					<comments>https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/#respond</comments>
		
		<dc:creator><![CDATA[guyfawkes]]></dc:creator>
		<pubDate>Mon, 20 Apr 2020 07:52:32 +0000</pubDate>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<category><![CDATA[Apprise]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Kodi]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mediacentre]]></category>
		<category><![CDATA[Pushover]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Raspbian]]></category>
		<category><![CDATA[Slack]]></category>
		<guid isPermaLink="false">https://vpn-expert.info/?p=321</guid>

					<description><![CDATA[<p>Getting notifications in case of an event is not really a big deal these days. Most people have smartphones and use them to get messages. There are also several ways you can have your Raspberry Pi send a message to your smartphone. This works very well via Python (Pushover / Apprise), Slack but also email. [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/">curl: send messages from the Raspberry Pi (Linux) to Kodi</a> appeared first on <a rel="nofollow" href="https://vpn-expert.info">VPN Expert</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Getting notifications in case of an event is not really a big deal these days. Most people have smartphones and use them to get messages. There are also several ways you can have your Raspberry Pi send a message to your smartphone. This works very well via <a href="https://vpn-expert.info/coronavirus-beware-of-malware-better-make-own-update-ticker-monthofmaking/"><em>Python</em> (<em>Pushover / Apprise</em>), <em>Slack</em> but also <em>email</em></a>. But it is also possible to send messages to Kodi using <strong>curl</strong>. If your Raspberry Pi is responsible for an automatic process and you definitely want to be informed about important things, you could also have a notification sent to you when you watch a movie, for example.</p>



<p>It&#8217;s really <em>send to Kodi</em> and therefore it doesn&#8217;t matter if you use the multimedia center on an Android box or even a Raspberry Pi via <em>LibreELEC</em>.</p>



<p><strong>Note:</strong> All other methods that allow you to send parameters to Kodi via <em>POST</em> also work. Under Linux <em>curl</em> is very handy because in most cases it is preinstalled. As far as I know it is also preinstalled on the Raspberry Pi, more precisely Raspbian. If not this command helps:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">sudo apt install curl</code></pre>



<p>Now the problem is solved.</p>



<h2 class="wp-block-heading">Allow remote control via HTTP &#8211; then curl works</h2>



<p>However, there is one requirement for sending a message from your Raspberry Pi to Kodi. You must <em>Allow remote control via HTTP</em> in the settings. This is not difficult. The path looks like this:</p>



<p><em>Settings > Services > Control > Allow remote control over HTTP</em></p>



<p>Here a screenshot as a reference:</p>



<figure class="wp-block-image size-large"><img decoding="async" width="1024" height="576" src="https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-1024x576.jpg" alt="Allow remote control via HTTP in the settings – now you can send messages from your Raspberry Pi via curl" class="wp-image-323" srcset="https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-1024x576.jpg 1024w, https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-300x169.jpg 300w, https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-768x432.jpg 768w, https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http-1536x864.jpg 1536w, https://vpn-expert.info/wp-content/uploads/2020/04/kodi-control-via-http.jpg 1600w" sizes="(max-width: 1024px) 100vw, 1024px" /><figcaption>Allow remote control via HTTP in the settings – now you can send messages from your Raspberry Pi via curl</figcaption></figure>



<p><strong>Tip:</strong> To create a screenshot in Kodi use the keyboard shortcut <em>ctrl</em> + <em>S</em>.</p>



<p>That&#8217;s all and you can now send messages from a Raspberry Pi or any other Linux distribution to the Raspberry Pi using curl. The command itself works like this (you have to change IP address and port accordingly):</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">curl -v -H "Accept: application/json" -H "Content-type: application/json" -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"My Title!","message":"My Message","displaytime":'"5000"'}}' http://&lt;IP address Kodi>:&lt;Port>/jsonrpc</code></pre>



<p>But as you may have noticed in my screenshot of the settings, you can only control my Kodi installation via <em>username</em> and <em>password</em>. If you set it up that way, you have to pass both parameters to curl. The addition <em>-u username:password</em> does that. The command now looks like this:</p>



<pre class="wp-block-code"><code lang="bash" class="language-bash">curl -v -u username:password -H "Accept: application/json" -H "Content-type: application/json" -d '{"id":1,"jsonrpc":"2.0","method":"GUI.ShowNotification","params":{"title":"My Title!","message":"My Message","displaytime":'"5000"'}}' http://&lt;IP address Kodi>:&lt;Port>/jsonrpc</code></pre>



<p>The parameters <em>title</em> and <em>message</em> are clear. They just send title and message. The <em>displaytime</em> shows the duration of the message on the screen in milliseconds. So in my case it would be 5 seconds. A parameter <em>image</em> would also be possible, as you can read in the <a href="https://kodi.wiki/view/JSON-RPC_API/v8#GUI.ShowNotification" target="_blank" rel="noreferrer noopener">wiki of Kodi</a>.</p>



<p>The result in a movie would look like this:</p>



<figure class="wp-block-image size-large"><img decoding="async" src="https://vpn-expert.info/wp-content/uploads/2020/04/kodi-my-message-1024x576.jpg" alt="I sent a message to Kodi using curl" class="wp-image-322"/><figcaption>I sent a message to Kodi using curl</figcaption></figure>



<p>Even if you don&#8217;t have your smartphone near you in the evening or set it to quiet so you&#8217;re not disturbed while watching your movie, you can have important messages sent directly to Kodi.</p>



<p></p>
<p>The post <a rel="nofollow" href="https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/">curl: send messages from the Raspberry Pi (Linux) to Kodi</a> appeared first on <a rel="nofollow" href="https://vpn-expert.info">VPN Expert</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://vpn-expert.info/curl-send-messages-from-the-raspberry-pi-linux-to-kodi/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
