Hello and welcome to this session. This is Professor Farhad. In this session, we're going to be doing accounting for foreign currency transaction. This topic is covered in advanced accounting as well as international accounting, and it's surely covered on the CPA exam, the FAR section. If you want additional lectures about these topics, please go to farhadlectures.com. Now before I proceed, I would like to make a quick announcement. Please connect with me. I really like to know my viewers. I like to connect with them on a personal level so you could connect with me on LinkedIn. I have a Facebook page for my website. Obviously, if you're watching this on YouTube, please subscribe to my YouTube and connect with me on my Twitter account. So let's start to take a look at foreign currency transaction and what do they entail. So it's a very important concept and you need to learn about it. What are the problems with recording and reporting foreign currency transactions? Here's what's going to happen. You have a U.S. company buying goods and services from Germany. And here's what's going to happen. They're buying the goods and services from Germany. The German company, they want to be paid in euros. The U.S. company, they'll have to record their transactions in U.S. dollar. So transaction in a foreign currency must be translated. So now we're going to be doing what? We're going to be translating. It means express them in a dollar amount because we are U.S. centric. I am U.S. centric. We're always assuming we are the home currency, the U.S. currency, before they can be aggregated with domestic transaction. So any transaction will have to be translated. And if you are buying or if you are selling, you might have a receivable or a payable. So if you are buying from a foreign, from a Germany, you're going to have a payable. If you are selling to a German company, you're going to have a receivable. So you're going to have payable and receivable that are denominated in foreign currency. But when we report them, they're going to be reported in U.S. dollar. And if you don't know this, there's going to be changes in the value of the currency. Therefore, we might have a gain and we might have a losses, which we will talk about in this session. Now also, company might use hedging strategy with derivatives to minimize the impact of exchange rate. Why? Because exchange rate could go up, could go down, depending if you have a receivable or a payable. I'll explain this. You might be hurt or you might benefit. But you don't want to take that chance. You're not in the business of playing the foreign currency market. You are in the business of selling your product, making sure you are paid and making sure you are paid enough money to compensate you. So that's why you might use hedging strategies, which we would look at in the next session. So the hedging strategy, just hold on it for now. Basic terminology you need to be aware of when you are dealing with foreign currency translation is something called the direct exchange rate and the indirect exchange rate. They're basically the same thing depending on how the information is given to you. You need to know the difference. So what is a direct exchange rate? Okay, it's the unit of domestic currency. And again, we are the US domestic currency that can be converted into one unit of foreign currency. For example, we could say the direct rate is $1.51 pennies for one British pound. Simply put, you need $1.51 pennies to buy one British pound. Or we might say, for example, for a euro, $1.30 for a euro. So you need $1.30 for the euro, $1.30 US cent to buy one euro. This is the direct exchange. How much your currency buys in another currency? Okay, for example, you might need only 0.0010 to buy one yen. Or on the other hand, we can express the currency in the indirect exchange rate. What's the indirect exchange rate? It's how much you need foreign currency to buy US dollar. And all you have to do is take the direct rate and divide it by 1.517. So simply put, what you need to do is if you take 1 divided by 1.517, it means you need 65 British pound to buy US dollar. So simply put, you will need 65 British pound to buy a dollar. Now for the euro, let's do the same thing for the euro. How much euros do you need? Well, let's find out. 1 divided by 1.3. You need 76 euros to buy US dollar. Well, for the yen, 1 divided by 0.001. I just made up this up 0.001. You need 1,000 yen. So you need for the yen. So if you are a Japanese individual, you need to have 1,000 yen to buy one US dollar. This is the indirect rate. The US will say we need 0.001 to buy a yen, which is less than a penny. So make sure you know the difference between direct and indirect, and I will try to hopefully make it easier for you when we look at the problem. Other terminology you need to be aware of is the spot rate. What is the spot rate? The spot rate is the rate today. How much today, or at this moment for that matter, because the exchange rate changes constantly. How much you can exchange your currency into a foreign currency? The rate at which currencies can be exchanged today or this moment. Then you have to know what is a forward or future rate. What's the forward rate? It's the rate at which currencies can be exchanged at some future date. For example, today's date is what? Today is November the 16th. So this is the spot rate, November the 16th. Now I can look up the forward rate for a currency. For example, let's assume the euro today is $1.30. I want to know on December 16th or December 16th, a month from now, how much can I buy euro? Well, they might say you can buy the euro at $1.25. You might be able to buy the euro at $1.35. This is the forward rate. So if you know you're going to have to come up, you have to pay something in euro. For example, you want to pay your German supplier in euro. Today, the rate is $1.30, but you don't have to pay them until a month from today. Well, you don't want to wait until a month from today because a month from today, the euro could be $1.50 or the euro could be $0.90. Who knows? So you don't want to take that chance. You might buy something in the forward market to lock in your rate at $1.25, $1.35. Whatever the rate is, you can lock it. So it's the rate that you can lock. Basically, you will pay a fee and as a result, someone will guarantee that on that date, if you won't buy the currency, you can pay, for example, $1.28 and will guarantee you, will deliver German, I'm sorry, not German euros to you for that rate. So this is what the forward rate is and we're going to work problems with that. Forward exchange rate. This is what I'm talking about now. Contract to exchange currencies of different countries on a stipulated future date at a specified rate. This is called the future rate. So how much do we agree to exchange the rate? So someone will say, pay me $100 today as a fee and I will sell you the euro for $1.28, December the 16th. So basically, they are guaranteeing it. It's their risk. You're just going to pay them a fee. Okay, that's their job. What is a floating rate? Floating rate means the rate between currencies always fluctuate and that's why we have to learn about this chapter. So relationship between major currencies is determined by supply and demand factor, political risk, economic risk, so on and so forth. Okay, increase, risk the companies doing business with a foreign company. So what happened is this, when you buy goods and services from a foreign company and you have to pay them under currency, you might be taking a risk. Why? Let's assume you have a payable of 100,000 yen for payable 100,000 yen. All right, what does that mean? It means let's assume a month from today you have to pay this money. Today, what happened is this, today when the transaction took place, you owe the Japanese company 100,000 yen. Well, you can buy the yen at .0043. So this is the spot rate. On the transaction date, the spot rate.  Okay, now let's fast forward when the settlement date came. The settlement means when the day you need to pay them, to settle the transaction. Guess what? Now you need .006 to pay them the 100,000 yen. So 100,000 yen times .006, you need $625. You might be saying, oh, what's the big deal between 434 and 625? Well, if you add zeros to these amounts, then the risk is substantial. So that's why you have a risk when you buy Japanese product. You have the risk because you're going to have to pay them in Japanese yen. In Japanese yen between now and the settlement date could become cheaper, which is good, or it becomes more expensive, which is not good. So again, this, let's assume, just kind of just tell you, this also works in your favor. So let's assume on the settlement date, the rate is .0030. Just to make it easy. Then only what you have to pay is $300.  But again, that's the risk you are taking, and you're not in the business of foreign currency risk. You're in the business of buying material, building your product, selling your product. So transactions are normally measured and recorded in the terms of the currency in which they are reported, in which the reporting entity prepares its financial statement. Once again, we are talking US dollar for our purposes. So the reporting currency is usually the currency where the company is located. Again, US dollar for our purposes. Your reporting currency could be different. If you're in Canada, it's the Canadian dollar. Transaction between a US firm and a foreign company, okay? Company negotiate whether settlement is to be paid a US dollar or a foreign currency. So if it's a US dollar, there is not really a lot of risk, but if it's in a foreign currency, then you are taking a risk. If settled by foreign currency, the US firm measured the receivable or the payable in dollar. We have to measure them in dollar, but the transaction is denominated in foreign currency. So when we say you're going to have to pay 100,000 yen, well, we don't record on our books 100,000 yen. We convert 100,000 yen at 0.04, and we say it's 0.004, and we say we have a payable of $400. Okay, so it's denominated in the foreign currency, but it's recorded in US dollar. So foreign currency transaction require payment or receipts in a foreign currency, okay? So US firm exposed to risk to unfavorable changes in exchange rate. Now, just one, you know, it could be unfavorable or it could be favorable, but what we are discussing here is the risk and risk. We're going to assume unfavorable. Now, how does it work? If the direct exchange increases, what does that mean? Okay, or it means the foreign currency weakened if the direct exchange increases. So let's assume $1.30 to buy a euro. Okay, this was the spot rate. Now, let's assume you have a payable. We have an accounts payable, and you purchase 100,000 worth of euros. Right now, you need $130,000. Let's assume the foreign currency unit strengthened. What does that mean? It means now you need $1.40 to buy a euro. Okay, $100,000 times $140. Now your payable is $140,000. Well, it means more dollars needed to acquire the foreign currency. What happened is this, the foreign currency strengthened. You need more. Instead of $130, you need $1.40. Now, what happened is you have to come up with more dollars. What does that mean? It means you are at a loss. You are at a loss. Now, let me give you the other scenario. The other scenario is if the opposite happened. Well, let's look at the other scenario. If the direct exchange decreases, so simply put now, so the euro now is $1.25, and you have to come up with 100,000 euro. So you need 125,000. It means the foreign currency weakened. Well, guess what? Now you need fewer dollars to acquire the foreign currency. Therefore, you are at a gain. You are at a gain. So remember, but this relationship is the opposite. If you have a receivable, if you have an account receivable, if you have an account receivable, you want the US dollar to weaken. If you have a receivable in foreign currency, you want the US dollar to weaken. Why? Because when you receive the German, the euros, if the US dollar is cheaper, you can buy more US dollar. So the opposite with account receivable. If you have a receivable, you want your home currency to go down. If you have a payable, you want your home currency to go up to strengthen. It means the other currency to go down. So if your currency is strengthened and you have a payable, you want that. You want a strong currency if you have a payable. What dates we need to be aware of? Okay. Translate an account in denominated in foreign currency. We have to be concerned with three dates. Sometimes it's two dates. Sometimes it's three. First is the transaction date. The date the transaction takes place. Two is the balance sheet date. Balance sheet date means that the transaction took place and it's not going to be settled until the next period. Then what's going to happen? You have to prepare the balance sheet. So you have to worry about the balance sheet date, but we have to do on the balance sheet date. Then we have the settlement date, the date that you have to pay the money. This is the settlement date. Three different dates. And this is as complicated as it gets. So what you have to do in those states, increases or decreases is generally reported as a foreign currency transaction or gain. Sometime referred to exchange gain or exchange loss. Know that it goes on the income statement. So any gains and losses in a foreign currency goes on the income statement. This is important. This is important. Gains and losses from a foreign currency goes on the income statement. In other words, they don't go on the balance sheet and other comprehensive income. They go on the income statement. So let's take a look at an example to see what we are doing here. Okay. During December of the current year, Tel-Atax system, a company based in Seattle entered into the following transaction sold. So we're going to have a receivable. Seven office computers to a company located in Colombia for 8,541,000 pesos. On the state, the spot rate is 365 pesos per US dollar. So simply put, we shipped goods to Colombia. As a result, the Colombian will have to pay us, but they're going to pay us in pesos. Not Mexican, Colombian pesos. And we know as of today, as of today, each 365 pesos will buy a US dollar. This is the indirect exchange. This is the indirect. If you are not comfortable with the indirect exchange, convert the indirect exchange into a direct exchange by taking one divided by 365, which is 0.0027. So each 0.0027 US dollar will buy you a pesos. Or in other words, 365 pesos will buy you US dollar. It's the same thing. So how do we record the transaction? Well, guess what? First, we have to record the transaction in US dollar. We have a receivable. So we'll take the amount of the pesos, which is 8,541 pesos. And we're going to divide it by 365 pesos. And as a result, we're going to have a receivable of $23,400. Once again, we divide it because we are giving how much pesos can buy us in US dollar. So we have a receivable of $23,400 and sales of $23,400. This is called the transaction date. On the transaction date, we use the spot rate. And the spot rate was each 365 pesos will buy you a US dollar. Or 0.007 US dollar will get you a pesos, a Colombian pesos. Now, let's take a look at the transaction on December 31st because this is the balance sheet. Prepare the journal entry to adjust the account as of December 31st.  Create a receivable, a T-account receivable. I'm just going to put it right here. A receivable, account receivable. And we have in that receivable 23,400. So on the side, on a piece of paper, right, 23,400. Now, assume on December 31st, the direct exchange was 0.00268. So could you tell me what happened now to the Colombian pesos? We used to need 0.0027. Okay? Now all what we need is 0.0026. What happened to the US dollar? The US dollar strengthened. Strengthened, get is stronger. The US dollar is stronger. Is this good for us or bad for us? This is bad. Why is it bad? Well, because we have a receivable. It means, now, if we get the money, we buy less US dollar because the dollar strengthened. Therefore, what's going to happen is this. I shouldn't have erased this, but I will do it again. So remember, we have a receivable of 23,400. Now we re-measured the receivable. Well, that's an error. So now we have 8,541,000. If we converted at the date, at December 31st straight, now our receivable is worth 22,840, but it was worth 23,400. What does that mean? It means we lost the receivable, lost value of $500. Let me do the T-account here. Account receivable, we had 23,400. Now we're going to have to reduce by 510. Now the receivable is 22,890. Therefore, we have to reduce the receivable. So we credit the receivable 510, and we debit transaction loss, which is an income account. It goes on the income statement. Now the receivable is 22,890. We're not done yet. We haven't settled the transaction. We're going to wait until the settlement date. But all what we know now is of December 31st, we have a loss. Let's look at the settlement date. The settlement date was January 10th. Assume that the direct exchange rate at the settlement date is 0.32. What happened now? Well, here's what happened. The rate started at 0.0027. Then it became the direct exchange became 0.0026268. So the US dollar strengthened. Then by the settlement date, the US dollar weakened. Now we need 0.0032. The US dollar weakened. Now if you want the indirect exchange, in case you are wondering what's the indirect exchange, just take 1 divided by 0.0032. It means now you need 312 pesos to buy a dollar. So the pesos increased in value. It means we weakened. And we like this. Why do we like this? Because we like this because we have an account receivable. We want the US currency to go down. It means we need more US dollar to buy a pesos. It means the pesos will buy you more US dollar. We're receiving pesos. We want the US dollar to go down. We want the US dollar to go down. Now let's compute how much do we need. Well, by the settlement date, once everything is settled, let's compute what we need. We have 8,541,000 pesos. Now we're going to settle them. It means we're going to have to pay it. Pay it at 0.0032. Simply put, I'm sorry, we're going to convert them at 0.0032. We are going to receive 27,331 dollars. Hold on a second. The last time the receivable was worth 22,890. By the time they paid us, the pesos really went up and we did very well. So this is the US dollar. So we're going to be receiving. Once we receive the pesos, we convert it at 0.0032 because the US dollar weakened and bought us more US dollar. Account receivable is 22,890. That's the last time we computed the receivable, 22,890. We remove it and we have again a 4,441 and this gain goes to income. So we have a gain. Notice because you have a receivable, you wanted the US dollar to weaken. First, it strengthened. First, it strengthened at the settlement date. You had a loss. By the 10 days later, the US dollar weakened. Something happened from December 31st on January 10th, which is good for us. The US dollar weakened. The pesos went up.  And this is really a large gain. 4,400. Now bear in mind, overall, you had a gain of 4,400. But remember, this is not the net gain. If you want to know the net gain, 4,400 minus the $510. Remember, you had a loss earlier. You had a loss. So the difference between them is the net gain on the transaction, the net gain. Now let's take a look at another on the other side of the entry. Now we did the receivable. Let's do a payable because it's good to look at both to see how this works. During December of the current year, Tel-Atax company, a company in Seattle, Washington, entered into the following transaction. Now we purchased computer chips from a Taiwan company. So we're going to have a payable, a foreign currency dominated payable. That's worth half a million Taiwanese yen. The direct exchange on this date, the direct exchange was 0.0391. Simply put, we sold them, I'm sorry, we bought from them half a million worth of Taiwanese dollar. Now they want to receive Taiwanese dollar. They're not interested in US dollar. Therefore, today, if we take half a million times 0.0391, so how much are we responsible for? So half a million times 0.0391. We are responsible for 19,500. We have a payable of 19,500. So this is the direct exchange. So you need three pennies, 3.91 pennies to buy. So simply put here what we're saying, you need 0.0391. If you want to know the indirect exchange, take one divided by 0.0391. So you need 10.98 to buy a dollar. 10.98 Taiwanese to buy a dollar, just if you're interested in that. So on the transaction date, we record the payable, either debit purchases or debit inventory, depending on the inventory system we are using. On this date anyhow, we have an accounts payable dominated in a foreign currency of 19,550. Again, what I suggest you do is to create a T-account, call it accounts payable, and park in there 19,550. And this took place on December 12th. On December 31st, the Taiwanese rate, now if we want to buy Taiwanese dollar, we need 3.0351. Well, what was the priority? The priority was 0.0391. Now the rate, all what we need is 0.0351. We need less US dollar. What does that mean? We are at the game. Now in this situation, the US dollar is stronger and that's good. Why? Because we have a payable. We have a payable, we want to have a strong US dollar. Why? Because with a strong US dollar, we need less US dollar to buy Taiwanese dollar. Okay, so let's see how it works. So now half a million times 0.0351. Well, we need 0.0351 to buy the Taiwanese dollar. So we need to come up with 17,550. The balance in the payable was 19,550 when we initially took the transaction on December 12th. Guess what? We have 2,000. We are responsible $2,000 less. So now what's going to happen? You debit the payable 2,000. Now you are responsible for 17,550. And unfortunately, that's not the settlement date. That's the balance sheet date. So now we adjusted our books to make sure we show the risk of deferring currency transaction or in this situation, a reward. We have a gain. Remember, this gain goes to income. So now our net income went up by $2,000 as a result of this transaction. That's very good. But not yet. Not yet. We still going to have to wait until the settlement date. Now, maybe we should do it now and settle it today and send them the money. Okay? But we're going to have to wait. Okay? On January 10th, that's when the settlement date took place, the exchange rate was 0.0398. What was the prior date? The last time we did it was 0.0351. Oh boy. Now the US dollar strength, the US dollar weakened. We need now 0.0398 to buy a Taiwanese dollar. So we have half a million of those. We are responsible for 0.0398. Let's do the math. Let's see how much do we need. Half a million times 0.0398. We need $19,900. We need $19,900 to settle. Yeah, to settle because we have a payable. And the last time we thought our payable was $17,500. Okay? Last time we measured the transaction. Well, simply put. So we need to come up with cash $19,900. Our payable is $17,550. Now we have a transaction loss of $2,350. Now that's not too bad. Well, what's the net transaction? What's the net foreign currency transaction? We had the gain of $2,000, a loss of $2350. Yes, overall we had a loss of $350. Overall. Okay? Compared to the initial first transaction. Okay? So we have a loss, but it's only $350. Just make sure you remember that any foreign currency transaction gain or losses are included in net income, are included in net income. And we have two transaction approach for this. The sale or purchase is viewed as a transaction separate from the financing arrangement. Okay? Therefore the dollar amount recorded in sales or purchases is determined by the exchange rate on the transaction date. And what we can do, we can have the adjustment of the foreign currency denominated and receivable or payable recorded directly the transaction gain or loss recorded in net income. Okay? So it's just basically simply put all in all gains and losses goes into net income from foreign currency translation. We have a receivable might go up, a receivable might go down, a payable might go up, a payable might go down. The offsetting entry either a gain or a loss in the foreign currency and gain or a loss once again goes into net income. Now why I keep emphasizing this point? Because when you look at, when we look at the translating financial statement, well, we have to know if it goes into net income or OCI, other comprehensive income. So that's why I'm emphasizing this point. If you have any questions, any comments by all means email me and please visit my website for more lectures. If you happen to visit the website, please consider donating. If you're studying for your CPA exam, as always study hard. It's worth it.


grams here on newsclick.in. We are at Adidas, the base in New Delhi and we've been joined, Arjun Pandit and I have been joined by Lali Anzoala Changte of the Delhi Dynamos and his agent Raghav Sood representing the sports company. Now if you're watching this show, the chances are that you're a bit of a football fan so you would have heard that Changte is on his way to Norway to play for a trial with Viking FK, Viking Football Club. It's based in a small town called Stavanger in Norway which you might have heard of from the girl in the with the dragon tattoo that series otherwise there's no reason. Yeah, so most people will not have heard of him. So thanks for coming in here guys. We're excited about the trial that you're going on. How excited are you? Yeah I'm really excited because when I heard the news from this guy, I'm very surprised because getting the invitation letter from this club, one of the most successful club in Norway, it was amazing to get this opportunity for me. Raghav, before I get back to Zoala, could you tell us how much back and forth was involved? How did this deal go about happening and from how long have you been pushing clubs abroad to get Changte on the ground? Just to give a brief about Zoala, he's been always willing to play outside India so you know when we signed him. Since then, we started to win him on our networks outside India. So with this club, we did not only approach this club, we approached a couple of other clubs in Sweden, in Poland. And that's how they were growing up in Poland, also that showed interest, ran a club in Sweden and also that showed interest. But you know with Delhi Dynamo's relation with Viking FK, they also were very keen on exploring this and you know the way Viking FK did all the invitation letter, specialism that they showed. You know that was it and that's why we are taking this opportunity. But for people watching this right now, how does it work man? As an agent, you're giving videos of the player, you're telling them this is what he's done as a CEO. So with this Viking FK, we were very lucky because the CEO, Mr. Eric, was in Delhi in December and Zoala was playing in the ISL. So you know we had asked him to have a look and then after that we definitely, you know, we brought all the videos created at our office, making his insta profiles, CVs and everything and that's how we sent everything to all the clubs that we approached. Did you put the Nepal goal? Yeah, yeah, of course. There are a couple of other goals also. So you share that video, right? We can show it also. So a lot of the chat when India were going to the Asian Cup, we were expecting that if the team does well, they will generate some interest among clubs, at least Asian clubs for Indian players. Have you sort of, did you think about the idea of playing elsewhere in Asia as well or were you focused only on a Europe sort of thing? Yeah, actually since I was a kid, dreaming to be a professional football player and so what I was doing, to play outside India was my dream, playing outside India. But of course we watched a lot of English Premier League and European football. So playing in Europe will be a dream come true. Is that what you told them? You said, was that the conversations? You said that look, I want to play outside India. Whether it's Europe, Asia or wherever, I don't care. Europe is my first choice, always, yeah. And you're talking about teams you were watching growing up, which was your favorite team growing up? Favorite team is Chelsea FC. Bad days with Chelsea FC. Yeah, bad days. And by the way, the Viking FC knocked out them in 2003 I guess, in Super Cup. So it makes sense to go to Chelsea right now. You've gone abroad to the Liverpool Youth Academy. It was only a one-week training stint. Learnings you've taken from there because once you go to Norway, you won't have much time to acclimatize. Time on the ball will be less, decision making will be less. So are you taking learnings from that time? Of course, of course. When I recall it back, that time, when we went there, the climate was so cold. And we need at least 30 minutes to warm up. So I know it is not going to be easy. Of course. And that time, when we were in Liverpool, the players were very fast, very physical. And we have to think before we get the ball. Before the ball comes to me, I have to know where I should pass, where I should go. So that helps me a lot now. So I think I'm mentally prepared now. And physically, I'm ready. And was there a lot of hard tackling as well?  Players come into you, get stuck into you. And then it sort of takes you time to get into it. Yeah, yeah, yeah, of course. But luckily, we haven't got much training time there. So I cannot kick some players as I wanted to. Have you been watching videos of Viking FK on YouTube, what they've been doing, at least seeing, highlighting? Yeah, yeah, yeah. What have you made of the team so far? I don't know much about the team, the players. But I watch their playing, I watch their goals, like the season goals. Can you tell us a bit about them, what did you make of whatever you've seen? I haven't got much profile from them. Actually, I don't know much about that thing. But I think they play the great football. You know, the ball on the ground, they're playing attacking football, I think. Raghav, just in terms of, I'm pretty sure there's not going to be only 4A into Europe. What Siddhan said earlier, from an agent's perspective, are you looking outside of Europe as well, say Asia and other continents? To be honest, we are keen on exploring that, like countries like Thailand, Australia, these could be good countries wherein firstly they are not, like Thailand to be honest, they are not far from India. And then the facilities, seeing the Asian Cup, the success that these teams have had, we are looking at, but we still, as he said, our first priority was Europe. But now that the football is globally expanding to Asia, we're looking at. Even though we know that it's not going to be easy, but still, that's our dream. Firstly, I think for a player to go outside and play, the most important thing is the mindset. And then second comes is the guidance. You know, if these young players don't get the right guidance of going out, making the bold move of going out and playing outside and trying, then things will not change. So it's more about the mindset. Quality-wise, there are so many talented players. We have seen the India under-17 World Cup team. A couple of them were in the main India team also. Some of them have gone out, she's gone out and played in Spain. So I believe it's more about the mindset and that's where as agents, we come into play that they should be getting the right guidance. Is there a case, I mean, still in a scenario where agents have to go to teams abroad and say, look, this is our player, rather than teams coming to agents here in India and inquiring, look, who's this guy? I think with the Indian football in mind, I think it's more of agents going to the clubs and approaching them and it's the start of a, let's say, a big name where things will change in the times to come. Obviously, with Indian football and national team also, it's improving day by day. So definitely the European clubs, Asian clubs will have a different view about Indian football now and hopefully tomorrow there will be Indian clubs approaching Indian players as well. Swala, of course, last time when you went to Liverpool for that one-week stint, you don't have the experience of the ISL with you. Now you're going with having played the ISL, you're pretty much one of those top 25 players in the country as well. How do you think your game has changed from that Swala that went to England to the Swala that's now going abroad? I think at that time I haven't got much experience because all I've ever played professionally was Sapa at that time. So going back here, I think it will make a big difference comparing to that time. So it will help me a lot. In what way? Would you say you're understanding? Yeah, of course, decision-making, understanding of the game. Even when you play professionally match day in and day out, so it helps you a lot by making mentally strong, physically strong. It will help me a lot. And I'm sure working under the foreign coaches, you know, Liverpool had the DSK, he was under Dave and now, you know, two different coaches in Delhi Dynamo and then the Indian national team. So that definitely helps a lot in changing the whole look to the game and understanding the game. Also, I've at least noticed when working on the broadcast, you have buffed up a little bit in terms of physicality. Is that a thing you say that I need to add a little more meat here, a little more muscle to go and play abroad? Yeah, of course. Because when I was in Liverpool Academy, even the 16-year-old player were very strong physically. So in my mind, I've got that in my mind. So I have to build my physical a little bit more. And now I think I'm a little more little worried. All our viewers, Zohala has 12 packs. And we're going to ask him after this interview to give us four packs at least, because we have zero packs. Please cheat, by the way. So, Raghava was talking about the mindset earlier. I wanted to just ask, now that with the ISL coming in, Indian players, at least the guys who are in the ISL are getting paid reasonably well. The chances are that the kind of money you earn playing in the ISL, you can save more than you will playing at a club abroad, because your cost of living, etc, etc, etc. So how do you approach this kind of, because you have to make a living also, and you have a short career, let's say 10 years, 15 years, you have to plan for the rest of your life. So how do you balance these two things out? The desire to play in Europe versus the money that, for example, ISL clubs are offering these days? Yeah, of course, it is a hard decision at the end of the day, because this year, by the grace of God, we played quite well. Not knowing that what we might get there and what offer we get there, so it's a hard decision. But since I was a kid, it was my dream to fulfill this thing. So I am willing to do this. Yeah, the money will come. He has the age right now on his side. You are 21 right now. Till how much are you giving yourself time that I am going to keep trying my luck abroad? Say another four or five years, is that what you are giving yourself? Or are you putting a time limit on it? I think it takes only a few days now. Just kidding. I am just kidding. Go to this one and bag it. Hope it happens, man. Hopefully. By the way, cut that thing. I don't want people to... No worries. So any conversation that you had with Gurpreet, because he has also played in the Norwegian League, and you guys were part of the national team set up? Not much, but I have been talked to him before. And also he told me that if you want to go abroad, you should go at this age. Not in 24, 25, 26. You should go at this age. He already told me when I was in the South Cup. So since then it was my dream again, and it inspired me a lot, that thing. And by the way, he went and he played well. And he came back and he is, you know, top. And one of the most earning...  Hopefully I get something. Become a more established player. And then come back to India as the real deal. Like something what Gurpreet has done. Also, since we are talking about Gurpreet, players who have experience of playing abroad. Sunil Chhetri. What are the sort of conversations you had with this guy? Because he has taken his game, his aura, everything to another level. So just tell us one-on-one, what sort of conversations have you had with him? Actually, he is, you know, a great leader. First of all. And he guided us a lot in the training pitch. Even when we make mistakes, you know, even if he gets disappointed, he never stops. Yes, next time, next time. Like that, he is a kind of player. So even when I was out of the squad, he told me, you will make next time.  Just keep working hard. And I know you are not bad players. And just not your time. God will make your way. So he told me that. So he is a great player. And of course he is a great leader. You know, so we were doing a show on the Eshac Cup. And we were saying, look, this is Sunil's last tournament. He is 34 because now it cannot be captain leader, legend at 38, walking on a stick.  You better watch out. Hopefully. Hopefully. But any conversations on playing abroad with Sunil, because he's also done that, he's played abroad? Not much, but I asked JJ about him and him. Yeah, both of them. And he told me that it's not going to be easy.  But they encouraged me a lot. Even JJ told me that the most important thing is following your dreams. So if you're willing to do this, you should go. So he told me that. Raghav, just one last final thing. If this doesn't happen, once we come to the close of the ISL, are you guys still again looking for... Yeah, I'm not sure about the years that Zoala would like to give to his team. But after the season ends, and if this does not work out, we are going out all guns. Even Asian countries also, for that matter, we'll be looking at. And can you give us a few names that you've tried and maybe it's not worked out? There aren't any particular names, to be honest. So how it happens is that we come across some partner agencies and they refer to us to some clubs. So it wasn't any... It was just an initial interest for us to name that club right now. What about the opportunity in Poland? I have Poland. I don't remember the club. Sorry, it's a very tough name. And we have it on camera. Yeah, yeah, yeah. Finally, Zoala, just a word. What sort of conversation have you had with family? Yeah, because this is a tough sport, man. You don't get to stay at home and now you're going abroad. Is there a type of kid who's always on FaceTime or what's that video called? No, no, no, actually no. But my mom never missed a day without talking to me. Every day? Yeah. She wants to talk to me every day but I told her that it's not possible. So she missed me a lot and this is a hard decision for us. For the family. You know, because we could have earned more than last year now but looking to that point my parents were very happy with all my performances and taking this decision is a big choice, a big thing but they always support me, always, always. How much do you involve your family in your footballing decisions? For me, they're my first priority. So if mom said no, you're not doing this trial, you're not going? No, she will not. I'm just saying, hypothetically. If mom says yes, then it's fine. If mom says no, then I'm going for it. Yeah, yeah, yeah. Last time when we both decided to go and chase our dreams when I told my parents also, my mom she doesn't understand much what will happen, what things are we doing actually but I explained to her and she said that it is your dream so you must fulfil and you must try to... Which mother is going to get in the way of her son's dreams, I would imagine? Yeah, yeah. I think to save her. She might not like the idea but I hope she misses you a lot more and you spend many years far away from home playing football in Europe and wherever it is that the game takes you. Thanks so much guys for joining us. We'll wrap up on that note. All the best. And we'll see you on 420 grams one way or the other when you're back. And one way or the other, let's take a promise if Zuwala does make it abroad, maybe even if not this time, whenever he does, he's calling us to that club for an interview. All expense paid. By the sports company. By the sports company. All plugs done, all sorted. Thanks for watching guys. See you next week.


Are you guys rolling? Mark? 70% of the Earth is covered with ocean. We've explored about 5%. We go find the world's greatest mountain range. It's the greatest mountain range. It's 50,000 miles long. It's got thousands of peaks on it that are higher than the Alps. It's got thousands of valleys that are 5 times wider, 10 times deeper, and thousands of times longer than the Grand Canyon. We find underwater rivers. We find a lost valley of animals. We do. We find octopuses that not only can change camouflage like that, but they're in shapeshift just like that. Boom, gone. You see an octopus that turns into a coral just like that. Bam. We find underwater waterfalls. We find lakes at the bottom of the sea. And that's in that few percent. So it is mystical to us. I mean it really, really is. Anyone that says that they think they know what's going on, it's full of it because you just don't.


I think we have more people than registered, so we could wait. Well, what time does it say? My watch is always, it says now. We can start anytime. It's up to you. Let's go for it. All righty, I'll get started. Where's our little doohickey? You got the doohickey? Yeah. Welcome to the 420 session at the, which day is it? Are we the embedded Linux day or the open IoT day? Or are they all the same day? It's all the same. OK. Welcome to our talk on prototyping with ESP32. I'm Ivan Judson, and my colleague Pamela Cortez. To give you a little bit of context about what we're talking about, who we are and what's going on, I am a sort of career academic who's gone into the commercial world. I have been three years at Microsoft at a startup before that. And in my role at Microsoft, I helped sort of get our hands wrapped around partner opportunities in IoT, working with the All Join Foundation Framework Consortium, and then rolled into a bunch of open IoT events being involved here. I have a little bit of experience all over the place, but what I've done at Microsoft over the last couple years is really engage in customer problems around IoT. And then more recently, I have taken all of that and rolled it up, and I've moved over into the product side. So I'm working in our Azure IoT product team, and I am specifically tasked with working on the Microsoft Connected Vehicle Platform, which we announced at CES this year, with a whole bunch of details left unanswered intentionally. And I have been working, I'm sure there's other things that we were going to talk about, but I have been working with Espressif and the ESP8266, and now the 32 for about a year building various ideas and products. And I have a little bit of a startup passion, so I've been advocating these devices in various scenarios. So I'll let Pamela introduce herself, talk a little bit about what she does. Thanks, Ivan. So my name is Pamela Cortez. Before Microsoft, I worked at SparkFun like Tronix in the engineering department. So I did anywhere from Harvard Engineering to their software league, and then anywhere from making a tweeting turkey to playing office pranks to robotics and going out and teaching as well. So I'm interested on your guys' background. Are you guys mostly embedded Linux? Who's the embedded folks? And then who are the folks where they're focused on the cloud side of IoT? Everything, could be both. Raise hands. I love it. All the end-to-end IoT solution. So we like to think of this more of like a chalk talk where it's very interactive. So if you have any questions, let us know and just interrupt us. And if you have anything that experienced in some of our products or some of the open source commits that we've done and would say you have positive or negative feedback, feel free to give it to us because we want to hear it as well. So I'm going to get started on really what the agenda is going to be for this talk. So we're going to be talking about the prototyping process and really high level on that. And then we're going to talk about the ESP32 background. And who in here has worked with the ESP8266? So we got you. Who's already worked on the ESP32? Great, great. So that gives me a little bit more contact. So I could talk a little bit more about what is the ESP8266 and ESP32. And then we're going to talk about Azure. And then Ivan's going to do an ESP32 demo. So I'm going to talk really high level on the prototyping process for IoT devices. So first step, number one is come up with that new idea. So anywhere from, let's say you have an idea for a streaming device for home automation, or maybe you're just copying Alexa and deciding to make your own device, just starting off with an idea and what you want for your product. The next step is actually thinking about the requirements. So for example, what's it going to do? Do you want to stream video? Do you want to stream audio or none of the above? Or maybe the tenant use of it is being able to have a home automation device. But sometimes you have to think about the real life use, because sometimes people will take your product and totally use it for the different use case, which we see all the time. Or even hack it as well, which I believe is the fun part. But if you're trying to have a product in the consumer side, you don't want anyone being able to hack your product of course. And then doing market research. So if you're going to do this product that I just described, and there's already 50 other companies doing it, is that something that you want to do? Or what is the difference between your product versus other products? And then device selection. So budget is a real big thing, especially when I was doing hardware engineering. We thought about the bill of material all the time. And the reason for that is because if we're building a cheap Wi-Fi solution and our bomb, our bill of materials is $70. And our margins need to be at 4X. There's no way that we could actually be competitive in that market. So budget is actually a really big topic for engineers. And then device lifecycle too. Is this something that's going to be out in the field for 15, 20 plus years? Or is this something that you think is going to last for the five years? So it's something to think about. And then of course, how you connect to it. So a big topic right now is remote monitoring in places where there's no Wi-Fi or Bluetooth. How do you deal with that? How do you connect? Is it through gateways, cellular modules? So that whole methodology of how you design devices is very different than designing and consumer devices. And then also for device selection, you've got to think of products that are going to be end of life. So if you've got a really great deal on a microcontroller from eBay and you're thinking, oh, that's great. And then your product gets big. There's going to be, you're going to have some tough learnings from that, especially if you want to have millions of devices. And you find out you can no longer use that chipset, mostly because it's end of life, so things like that. And then product, lifecycle. Development testing, device management. You're seeing a lot of great headway and device management. How you do over-the-air updates with firmware is a big topic, especially for security as well. Being able to patch those devices, if someone does get hold of those devices, is something to pay attention to. And then also product support. So if you have a product, let's say we'll go back to Alexa, because it's a really popular IoT product at the moment. One of the things to, or the echo, one of the things to think about is what type of technical support you're going to have for that. Because there's going to be a lot of beginners using the echo, so you want to be able to be sure that you have enough customer service representatives. And then if you have developers hacking with that project or that product, you need to be able to have the staffing for that as well. So that's super high level. And it's really going to set us up for the rest of the talk. So some of the actual devices that we have SDKs with and support for and a lot of our device SDKs, Ivan will talk to at the end of the talk as well. So I have anywhere from the ESP8266 to Raspberry Pi's, Edison's. One of the things to think about between microcontrollers and microprocessors, microcontrollers are really good at ingesting data and sending it to the cloud, doing really simple things. And the microprocessors are really good for, let's say you want something where you're doing compute on the edge. So you want to do something that you have all this amount of data, but you don't want to send all the data straight up to the cloud. You can do some of the analytics right on the device side and send what you need to send up to the cloud. And the reason for that is a huge cost savings. So it really depends on what type of scenario that you want to do. So let me know if you guys have any questions, but I would skip ahead. So why Expressive? Why are we here talking about it? And why Microsoft is putting an interest in it? Mostly because it's a low-cost chipset which is made by Expressive Systems. It's ideally under $20 for a dev board and easy to get started for. And also it crosses between the maker community, beginners, and then also startups and R&D research and to production. So you can actually go from prototyping to production really easily. Unlike some of the products in the maker community, some of them are great for prototyping, but when you go to production, you'll find out that there's not that support for it or it's hard to scale up with some of those products. And then also there's fast adoption by SparkFun, Adafruit, and many others using this chipset, which is great because it will help beginners out who want to, you know, their influencers in the communities, but maybe they don't know how to start it with hardware. It's easy for them to prototype their idea, bring it to an investor, and then be able to build up a team behind that idea as well. And then I forgot to mention that Expressive was named a cool vendor in IoT in 2016 by Gardner. And Gardner is really that gold standard of, you know, who are the leaders in IoT? And they say cool vendor, but it really means that they're the most innovative vendor at this moment. And it's mostly due to their open source community support. This is really taken off in the community. So let's say you are a maker who wanted to, you know, make a smart light bulb or a connected device or a connected appliance. You can actually do that really easily because there's such a huge community who's willing to help you out and open source code behind it as well. All right. I'm going to jump in once I can say. For those of you who've worked with any of the Expressive chipsups in the past, the 8266 development environment was not entirely open. There were most of it was, but some of the actual libraries that Expressive had built and distributed binary because of whatever management they had been going through. But in that process, and by working with them over the last couple of years, for the ESP32 in particular, it is entirely open. The entire tool set, the entire source for everything. So you can basically start from a piece of a board and an editor and build and run your app in minutes. It's a pretty straightforward process. And I think that they understand that they are in the hardware innovation business and leveraging communities, the open source and open tools from the community accelerates their business as well as everyone else's. So they really do get that sort of model. Yeah, yeah, definitely. And they're really good at building up that community as well. All right, and why the ESP32? So the ESP32 is, you can use it for many different applications. Anywhere from wearables, connected appliances, to streaming audio and video players, and even connective appliances, oh, I already mentioned connected appliances and home automation. So another thing is it has 12 years of committed expressive support, which is huge. Especially when you make a product, you wanna make sure that that product has support for a long time. And they're guaranteeing 12, even 20 years of device lifespan, which is really great, especially when it's going out in the field. Because a lot of the products that do go out in commercial enterprise scenarios do stay in the field for a really long time. And then also, it's mobile factors depending on your product requirements. So you can really just have it simply ingesting data straight to the cloud, or you could do stuff with that data before it goes to the cloud. So it's really versatile. So it comes in many different form factors to get started with. Here's a couple. So this one's their dev board. If you breadboard before, it nicely fits right into a breadboard. It's, you can connect it with jumper wires, really easy to get started with, great documentation. And then the next one is the rover board. It has an LCD in the back, and then extra components as well. What's great about this one, you can stream audio, you can do video. And so that's a great way of getting started without connecting a bunch of shields and everything with it. And then on top of it, you know, Adafruit and SparkFun, they're already making boards, development boards and shields for this product as well. So if you're a fan of their company, you can work with their past shields that were being used for the ESP 8266. How many of you are familiar, before you move off the slide, how many of you are familiar with the difference in the board versus the dev board versus the shield? Okay, so I just want to point out in this picture, the ESP 32 is actually only that part of the picture. It's this square here. The rest of this is their dev board. So it's mounted to expose all the interfaces on the 32. And it has some LEDs and buttons for resetting and firmware, and it actually has a UART serial, blah, blah, blah. I can plug into my USB port without an adapter. Which is really nice. Makes my life happy. Yeah, FTDI interface, that's what I was looking for. Yeah, because a lot of dev boards, you have to have the FTDI basic to connect with it and the extra boards. So it's the full package and you have to add sensors to it but it's still nice to get started with. So we're gonna. Of course we lose the time. So the ESP 8266 versus the ESP 32. So the 8266 came first and it's a wifi chip. Ooh, thanks for helping. And so this one is based on the Tensilica. It's a 32-bit microcontroller. And then the ESP 32 is still Tensilica, but it's a dual core LX6 microcontroller. And the reason why I wanted to mention that is because this company, the Tensilica, is actually we're using HoloLens and their technology in our HoloLens device. So little, little tidbit there. And then some other things are that the operating voltage and the operating temperature is the same between both chip sets. And then for the ESP 32, it has both wifi and Bluetooth. So something to think about is that the ESP 32 is not a complete replacement of the 8266 because there's applications where you don't need that Bluetooth. So if you don't need the Bluetooth, why spend more on your bill of materials to get that feature? So something to think about if you're deciding if you're gonna use it for your product or not. So the sensors, the ESP 8266, doesn't have any sensors included. So that's probably good if you just want a really basic microcontroller. And then the 32 has a hall sensor, capacitive touch, ultra low noise, analog, amplifier, which is really nice. So a couple different sensors you can use. And for GPIO pins, the 8266 has 17 pins. And then the ESP 32 has 32 pins. So there's a lot more pins that you can work with. But then again, it goes back to do you really need 32 GPIO pins for your application? And then I'm gonna tell you right now, I haven't done an application where I needed that many, but it could be very useful depending on what scenario you're using. For security, the jump from 8266 to 32, there's a lot more security features for the 32. They've done a lot of really great innovative updates to security. That doesn't mean that the 8266 isn't secure. It just means that the 32 with the Bluetooth support and Wi-Fi combined, they also have even more security features. Yeah. Mm-hmm, excuse me? How many bit curve? I don't remember off the top of our head, we can look at the specs. It's one of the things that's interesting in terms of the extra features we don't have in the table, but I don't think we talk about them later in the slides, is that the ESP32 actually has the notion of doing secure firmware. So it has memory protection, that if you mess with it, it'll erase itself. And it also has the ability to encrypt the flash and the bootloader. We don't do that in our demo because once you encrypt, then the process is longer for doing all the updates. You can't really do over the air yet with that way. And so we're not demoing any of that, but it has significant more security features as a IoT edge device that you want to put in a place where it may get tampered with and you want to be able to trust it. So. Yeah, thanks Ivan. And then for power consumption modes, we like to always point that out because battery management and power consumption is a huge topic for IoT. So for the 8266 versus the 32, things to keep in mind that is the battery management, the power modes are a lot better with the 32. However, there's also a lot more modes in the 32 that you could change for. So if you have any questions for that, let me know. And then there's also sometimes that the power consumption is gonna be more for the 32. It's mostly because you're doing more with the chipset the microcontroller and the scenario. Yeah, one detail in that that's useful is even in low power mode with the 32, there is an ultra low power co-processor that can be woken up and used. And so there's actually like, I wanna say eight different power modes in the 32. So in this table, we just tried to match up the most sort of the closest corresponding modes. Yeah, hibernation is the lowest state that they document. Yeah, this is literally powered off. It's still consuming that one. It doesn't have a powered off state. Yeah, so it's not a direct comparison when you get to the last numbers from off and hibernation. All right, so Microsoft Expressive, Adafruit and SparkFind. So we've had a really strong partnership with Expressive and also the maker companies as well. And the biggest thing that we take away from that is that we wanna be able to contribute to Expressive's ecosystem. So and make sure that it's able to connect to Azure right out of the box. It'll make it a lot easier for developers to get started with. And then we've also been working with Adafruit to create the 8266 kits. So for people can breadboard, different sensors like temperature, humidity, and really get started to see what you could do with the 8266. Other thing with that is that you could use the Arduino IDE, but you can also use the native CSDK as well, which I really recommend, especially if you're thinking about going into production. But if you're a maker or someone who wants to get started with it and you're comfortable with our Arduino IDE, there's full support for that as well. And you're seeing it with the ESP32 that's coming out for Arduino support. So that kind of just is what the kit looks like. All the code is open source. So it's the hardware is easy to get started. Wait, go back to the point I just wanted to point out. If I recall correctly, correct me if I'm wrong. This kit we put together with one of our partners. Adafruit? Adafruit. And this I think retails for $46.95, about $50. And it has all these components. This, the rover board, retails for about the same price, just about the same price. It has many of the same sensors, but not all of them. It has an LCD, which that doesn't have. And having given hundreds of hours of tutorials on IoT, I would rather carry these around and help people learn how to write software than match up pins to holes. Yeah. There's a big value to integrate it. Yeah, and LCDs are not cheap either. So they definitely got a really great deal on that dev board. Though I totally agree. And if you're not familiar with breadboarding you're just starting, it could be kind of a little intimidating for people as well. So as I mentioned, we have Wi-Fi, Bluetooth, and power management for the ESP32, and here's the pinouts, the 32 GPIO pins. So I'm gonna let Ivan take over and talk about the cloud side and the full end to end IoT solution. Well, let's see how it goes. How many of you have built IoT solutions with the cloud? Going to the cloud, about a quarter of you. How many of you have used Microsoft cloud at all, Azure? Okay, a different quarter of you. Fair enough. I'm gonna give sort of a very quick overview of what we provide in Azure, but mostly from the point of view of an IoT, trying to build something in the IoT space and have an end to end solution that delivers some value, not just to the customer, but also to you, because no one gets into the business of doing IoT just for fun, right? Go ahead. So ESP32 does not integrate with the funds like only A266? We'll get to that. That's part of our demo. Excellent question, but you're setting me up and I'm not ready yet. That's where we didn't plant him. We'll pay him later, but we didn't plant it. So this is generally the way we think about IoT in the big picture. And what you should notice here is this big bar in the middle is essentially where the cloud starts from the client point of view. This is, from here to the right is infrastructure that you would outsource to a cloud provider, Microsoft, Google, Amazon, whomever. And we would all provide functionally the same kind of solutions. We would provide what we call batch analytics, hot path analytics and hot path business logic. Business logic is things like real-time applications that trigger on the data coming in. So logic applications, lambda, we use actor framework, so we're monitoring things in real-time. Hot path analytics are more things where you're gonna process the data as it's coming in and do some interesting things on it, sliding window averages, aggregations, things like that. And then batch analytics is more where you're gonna do, try to extract insight and knowledge from the data that you're acquiring. This isn't something you're gonna do every minute, every hour, but you might do it daily, weekly, monthly. It's places where you would apply technology like Hadoop or Spark to process large quantities of data. Or in our case, we have things like Azure ML where you can build machine learning models and then execute them on the data as it flows in. You need that large quantity of data to train your model and then you can run your model as either hot path analytics or a logic app. Tell me when an anomaly is happening with my devices so that I can notify someone to go out there and repair. That kind of stuff. We have a bunch of infrastructure in these places that's Microsoft specific and so does every cloud provider. The only point I wanna make about this side is that one of the things we have worked very hard at over the last few years is to make sure that you can bring your existing expertise and add the value to this side of the pie with the tools and technologies you're familiar with. So you can write node based applications, Python. You can still do C sharp and various other Microsoft technologies but you can do it with essentially anything. Our Spark implementation is Python native so we're not doing anything sort of strange in that space. So that's kind of all the stuff that happens in the cloud. This cloud gateway, this is an old slide. This is now, if I were to make up, if I had gone and found the newer slide, this would say IoT Hub. IoT Hub is the cloud endpoint for IoT devices in the Microsoft ecosystem. IoT Hub provides large scale telemetry ingestion as well as command and control out to devices. We have documented plans for device management, software management and various other components that are going out to the device. I don't know where we are in the delivery of those plans and I'm inside the product team so I'm trying to be very careful not saying anything I'm not supposed to. We did release the device management and twins, methods, routes, all of that recently. So those are ways to build up data models on the cloud side that interact with the data on your device and so your device becomes a first class managed object. In fact, I think in the public GitHub repo I did see device methods. Yes, that's live. So device methods are the notion that you have an object over here that you can invoke a method on that goes all the way to your device, executes and comes back with a return that looks synchronous from the programming model. I'll leave it at that. It may or may not actually be but it behaves the way you would anticipate it. So from the cloud side, from IoT Hub, the next step out is what we talk about is the protocol adapter layer and you're all probably, if you've been in this business longer than five minutes, aware of the fact that everybody has their own protocol on the wire to carry data and do what they wanna do and everybody's protocol is the best one out there. So don't get into the trap of arguing just right in an adapter. So historically speaking, our protocol choice has been AMQP. We also now support MQTT as a first class citizen from protocol support. So over time, initially we had an MQTT to AMQP adapter. We now host that natively so that we can do AMQP and MQTT devices natively without another adapter layer. But you can imagine any number of other protocol adapters. They could be built for anything and in fact, this is how you bring in legacy devices where you can't change the protocol on the device. That's one way to bring them in. Another block you'll see up here is a thing we call the field gateway. So the notion of proximal networking is important. If you put a bunch of sensors out in an environment that's disconnected or lightly connected or in a place where you put a whole bunch of sensors that have short range networking, you can put a field gateway. Think of it as like a wifi router in your house out with them that can communicate to the sensors and then it can communicate to the cloud. That's what we think of as a field gateway. It can be either necessary for networking infrastructure reasons or because of logical architecture that it makes more sense to design a system that way. And then from there on out you have devices that are connected into your IoT infrastructure. And the point I wanna make before I leave this slide, which I am anxious to do, is that everything that we provide technology wise that's outside of the IoT hub today is available on GitHub. It's all MIT licensed. So the protocol gateways that we have out there, the field gateway SDK that we have out there and all of the client SDKs be them in C, Java, C sharp and some other set of languages I've lost track of. They are all available and people can play with them today without having to talk to us at all. And we're also expanding it to like for the gateway SDKs having support for OPC UA, which is really great for connecting legacy devices and industry 4.0. So it's something to think about as well if you're really trying to take your legacy devices mostly on the manufacturing floor and connecting them to the cloud. That's actually an interesting point. I'm gonna skip off that slide, but I wanted to point out that when I came from outside of the product team to the product team at Microsoft, one of my biggest axes to grind was why they weren't, why the IoT product team wasn't paying more attention to what I care about, which is innovation and product discovery. And then I was very nicely informed from outside of the company actually that our IoT announcement, sort of when we went live with our IoT solution, we went live at Hanover Massey, which is the largest manufacturing conference that occurs. And we went live with the ability to announce that every device on the show floor was capable of connecting to Azure IoT because we had put in the effort to build the gateways to make it happen and gave them away essentially. And so the fact that on day one, we lit up 38,000 devices made me realize we might have made a strategic investment that made sense. And so I had little criticism after that. So here's the things that you can do in building your own IoT solution.  Storing data for later analysis, all sorts of other stuff. And then we also have Azure Functions for this new fancy thing that everyone talks about serverless computing, which is really not serverless because they run somewhere, but it's a great buzzword. This is what IoT talks about, our IoT hub. Since I talked about it, I'm gonna skip over this. One thing that we do have that I think is interesting, and if you're in the space and you're going, I don't know what device I want, I don't know what capabilities I need, I don't really understand all this stuff that's out there when it comes to hardware. We have this thing called the device catalog that we host, it's catalog.azureiot suite.com. You can actually, you can't see it over here, but this is industry device type, tested compatible sensors, built-in sensors, OS, connectivity, hardware, interfaces, manufacturers, cloud protocol, geo-availability, so every potential sort of aspect of the device that you might wanna understand, we have a way to pivot on that data and look at the various devices that we've interacted with or that we know of. I'm gonna say this because it comes up on a later slide, but one of the key values that we bring to the conversation is a history of working with a very large partner ecosystem. Putting something together like this for us is actually pretty straightforward. Putting this together, if you have to go sign 99 two-way NDAs, just to get access to the spec sheet is a little bit cumbersome for a single person or a single entity. So this is something we can offer to the community that is a huge value. And one thing I would wanna point out is that Azure works on all platforms, as Ivan has said, and this device catalog really highlights that if you wanted to work on Windows 10 IoT Core, that's great, but we also have all these other devices and partnerships that use this WinRiver, Yachto, or no operating system at all. So we wanna really make sure that people know that it's not just Windows that is all different platforms that we're contributing to and wanting to help out with. Yeah, actually you'll notice that, what's community to do bring? So one of us brought a Windows computer, but the one we're demoing from isn't a Windows computer, because that's not the one I brought. Oh, a whole golly, I wasn't ready for demo yet, I hadn't teed it up in my brain. All right, so I'm gonna take you through a little bit of a tour and by tour what I mean is I am hoping everything works the way I expect it's going to. This is my desktop, that's a trout, in case anyone's wondering, I get that question a lot. I have to find the right window. So I am going to show you a couple of interesting things. So what you'll see here, if you could see, and it doesn't get bigger on that way, how do I make it bigger? I'm gonna point it out, and it's gonna be a pain. But what you see here is this is a top-level directory in my home directory called ESP. So what I've done, which is a pretty straightforward exercise, is I have literally followed the ESP32 directions off their GitHub page. Their development environment is called ESP-IDF. And so I've created an ESP directory, I've checked out the ESP IDF project from GitHub. I downloaded the Extensa tool set. So Tencilica is the company that actually maps out all the logic for the processor. They provide a tool chain called the Extensa tool chain. It's a GCC derivative for cross-compiling for their hardware. So you can see that that's installed here. Extensa ESP32-ELF. I put it in my path so that I could find the compiler, right? So now I have this ESP-IDF and Extensa tool kit, and the extent of the configuration was essentially, whoops, I can type, and I can make this one bigger. You'll notice I have this IDF path set. So I had to set an environment variable to find the IDF path, pretty straightforward. And then in my path, I had to add the Extensa tools, the bin to the tools. Literally, that was what I had to do to get started. Now, I've plugged in an ESP32 into my machine, into my USB port, and it is currently running as the slab USB-UR device. What you see here, actually I'm gonna start over so that you can see it from, I am going to go get bigger so you can see. So this is that ESP-IDF. That's not big enough for the people in the back. Tell me when. I can't see very well today, because I'm tired. So this is the ESP-IDF path. If you look at the readme, it'll tell you exactly the same thing as what I just did. Basically, check it out and do stuff. Now they have a make system setup that should look really familiar if you've ever built the Linux kernel in the old days. I don't know how it is today, I haven't done it in the last N years where N is larger than I'm gonna admit. But if I go to the examples directory, here's some simple examples, right? Here's a hello world example. So if I sit here in the hello world directory and I say make, menu config. It just keeps getting better, doesn't it? Yeah, it never, it always bites me somehow. There. So it goes through this very handy little configuration menu. If you look at this, the first option is the SDK. So it's gonna tell me that it's found the extensive compiler and it's using Python 2. I can do bootloader config, which is basically how verbose do I want the system to run. In the under security, you can see I can actually select enable secure boot and enable flash encryption. It says read docs first, because once you do this, you can't actually go back through the development cycle without more work. So they don't want you to be surprised as an engineer that you've made a choice that makes your life harder. Serial flasher config, this is where I can tell it things like, that's not where it is. I'm gonna go here. I'm gonna select this. I'm gonna not go there. I'm gonna go here and put it there. It sets itself to a reasonable baud rate, compresses things when it goes up. They have a couple of tools. One is make monitor, which I'm gonna show you, which is really handy in the development. I'm gonna save it just to be pedantic because save your work often.  You can choose how you want the partition table on the ESP32 to work. It has a couple of out of the box solutions. One is a single app with no over the air support. And the other one is, you can have a factory based app with two over the air segments defined so that you can then do over the air updates. I'm gonna leave it like it is for now because the demo is gonna change some stuff later.  And then in component config, this is where you start getting into the meat of what's included in the app that you're gonna build.  First thing to know. That way if you're doing wifi and you don't wanna use the power, just leave the Bluetooth off. Under the ESP32 specific commands or configuration, you'll notice a couple of things. One is you can select the CPU frequency which will affect your power consumption. The choices are 80, 160, and 240. It comes out of the box at 240. You can reserve memory for two cores. The ESP32 actually has two cores inside the chip and you can reserve memory for both. But also down lower you can say, if I can find it, maybe it's not here. Oh, it's on a previous setting, I think. No, it's gonna be here somewhere. I'm missing it. Somewhere there is an option to say lock the app to a single core. So then you don't actually need both enabled and you can save resources.  This is the ultra low power processor that is available to run even when you are in sleep mode. But you have to program it with assembly and their tooling isn't filled out yet, so I never enabled that. It's just not worth the work right now.  Real-time clock source. So you'll notice there's no clock which will come up later in my demo. Turning Wi-Fi on, this is the one. Under RTOS, I can say run the RTOS program only on the first core. So if I allocate memory for both and lock it to the first core, I'm wasting memory. If I don't allocate memory for both and I run it on one, I've kinda got the optimal resource stuff going on.  I haven't experienced any, but my experience is anecdotal. I haven't tested, so I'm not sure. That door doesn't like to be opened, by the way. Bunch of other interesting things. One of them being, where's the debug stuff? I think it's under here. There is an interesting debug behavior that they support where you can have the ESP32 when it has a problem dump its core. In one mode, you can dump the core to flash memory. And in another mode, it'll actually ask you to encode the core and dump it over the serial port so that you can grab it and they have tools for then converting it back to a core to analyze on your desktop, which I think is kinda handy. Anyway, I'm going to save this because I think that I haven't made any changes that are gonna kill me. You never know. And I'm gonna say make. For now, I'll just say make. Just for fun, to show you. So it's building all of its various pieces, and it's pretty quick and simple and straightforward, nothing magical going on, other than it's using the cross-compiler to target. Five minutes. There are cross-compilers for you to deal with. Yes, yes, it is. There are cross-compilers for most of the platforms, if not all of them, at least those three. It's a GCC port, yeah, for that. Now it's built, you'll see it says you can run make flash. I'm gonna run a couple of commands at the same time. I'm gonna run make flash and monitor. So now it's gonna actually flash to the device over the serial port, because I pre-configured that all on the menu. And once it flashes, it's gonna invoke the reset on the board and open a serial port monitor so that we can actually see it as it goes by, all the same sort of command. This is compared to the, so there you go. Now it's started and you can see it said hello world. And then it'll reboot again. And there's the output. So this is about the most amazing improvement in development over what we did with the ESP8266 that you can imagine. That was not fun to program. I mean, it was fun to program. It was high effort. This is fun and low effort. We have Azure IoT using MQTT running on the ESP8266. We have it compiling and mostly running here, which explains why I'm tired for this talk. The one place that we, the one thing we have left to connect, which I can show you actually for fun. Let's go now to ESP, ESPIDF, Azure. So I'll take you through what I did here really quickly. Merging to make environments. So Azure IoT C99 library, we use CMake. This is clearly not using CMake. It's using component make files and platform make files and makes infrastructure. So if I go into components, which is where it looks for default for subcomponents it wants to build, you can see I have an Azure IoT SDK and C. If I go in here, you'll see I built the component make file for the IoT SDK. It has all of the stuff that you need to build. I have pulled out a subset of all the various libraries because I don't need all of them. I don't need a MQP, I don't need HTTP and web sockets. I just want the MQTT layer. I'm gonna get the, I'm running out of time sign. So if I do make, and I'm just gonna go fast here, make flash, monitor, actually I have to go up here. I can spell, I promise. So I built it and there have been no changes. So now it's flashing, re-flashing. This will take about a minute and a half, two minutes because it's a fairly large binary. There's not a lot of optimization in the ESP32 build system. So there's a ton of object files that are still linked in and moved to the ESP32 even though they're not necessarily in use. There's a big opportunity in our community to come up with a single set of reliable object file implementations for things like around security that everybody doesn't have to include their own TLS layer every time. So here I am, I'm launching. You can see, you can't see it because I went by too fast, but what you can see, I've exited, what you'll see here, it fires up one of the first things that you see right here, which is interesting, is we're on the LF Events Channel Wi-Fi, we got our IP address, and I invoke an SNTP server to get local time because if I don't set my local time right, generating credentials sucks. So I set my local time and I print out the Portland time and Shanghai because that's where it's expressive, so I thought it was kind of cute. And then I've initialized the IoT SDK and I've created the client and I've set the message callback, which means I'm registering for when I get an MQTT message from the cloud and I've posted an asynchronous message to go to the cloud. And then in the background, when my work loop happens, you'll see I'm trying to connect to this endpoint, which is my MQTT endpoint, and the first thing that happens is it fails. And I can tell you from our experience with the 8266 that this failure is that I did not tell it what client certificate to provide when it did the TLS connection. So the cloud side is saying it's really nice you wanna talk to me, but I don't know who you are. And so that's where we are on the demo. But you can see we've got a whole bunch of stuff built. We'll share this on GitHub. It'll be freely available if anyone wants to do it. We have really good interactions with Expressif and others, and if you have questions, now is probably your time because if I talk anymore, he's gonna give me the, I have no time. Look, he's going to zero. Stop, I got the big red, stop. Thank you guys.